I'm aware that diff -e
can output an ed
script. And my understanding is that ed
and sed
share their approach, but that ed
is interactive, and sed
is for streams.
What I would like to do is take the output of diff -e
(or some other invocation of diff
) and munge it into an invocation of sed
such that invoking that command with the original "before" file as input produces output equivalent to the "after" file from the diff
invocation. I would like to format the command as a collection of -e <BLERG>
options passed to sed
to avoid having to write the ed/sed script to another file.
I've tried a bunch of obvious mungings, but I'm not getting the desired (or even reasonable looking) output, and I think I'm missing some overarching thing. Is this possible?
sed
?curl -s http://someurl.com | [Command I'm looking for] > outputFile
sosed
seems like the natural choice.