unix - Difference between sed -e and sed -f -
what difference between sed -e
, sed -f
options. of these should used in place editing. not able understand meaning man pages.
according manual page of sed
-e script --expression=script add commands in script set of commands run while processing input
this means sed executing commands passed directly on command-line such sed -e 's/foo/bar/g'
where as, -f script-file --file=script-file add commands contained in file script-file set of commands run while processing input.
while using -f sed expecting commands in file specified after -f
option. useful complex operations.
as long in place editing concerned, of options can used. example:
sed -i -e 's/foo/bar/g'