On 2017-07-07, Doc Trins O'Grace <
doctrin...@gmail.com> wrote:
> The sed usenet is rarely frequented by sed people. I hope that I am known well enough in this usenet that I can be permitted to ask a brief, simple sed question:
>
> In sed there are two switches I have about which I have a question:
>
> -e
>
> and
>
> -f
>
> Would someone kindly explain the difference between these two switches?
The argument to -f is the name of a sed script: a file which contains sed commands.
The argument to -e is itself a script of sed commands.
If your documentation is saying "-e script" versus "-e script-file",
you have to understand that "script" in "-e script" literally refers to
a script in the command line, not to a script file.
sed -e s/foo/bar/ # replace foo with bar
sed -f foobar # carrry out foobar script
If the file foobar contains nothing but the line
s/foo/bar
then the above two are equivalent.