On Wed, 16 Dec 2009, Martin McCormick wrote:
Warren Block writes:
sed(1) says it should be -E. Looks like it will only work on the whole
script.
Many thanks. I have had -e work many times
But -e does not mean what you think here:
-E Interpret regular expressions as extended (modern) regular
expressions rather than basic regular expressions (BREs). The
re_format(7) manual page fully describes both formats.
-e command
Append the editing commands specified by the command argument to
the list of commands.
So sed -E means "interpret regular expressions as extended" and -e is
followed by a command:
sed -E -e 's/a/b/' -e 's/x/y/'
if you call sed from either the command line or a shell script as in
sed -f somefile
with somefile being 1 or more lines of sed commands. When the
file itself is the script, the first line actually calls sed
from within the file.
I'm not clear on why you want to do it that way instead of simply
calling sed from a shell script, but sed -Ef seems to do what you want.
-Warren Block * Rapid City, South Dakota USA
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"