From: Bruno Haible Date: Fri, 18 Jun 2010 15:05:29 +0000 (-0600) Subject: Document sed -e limitation. X-Git-Tag: v2.66~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f08d6f4f9f35c08cf7c0dee2f90b1bb2c0fb809e;p=thirdparty%2Fautoconf.git Document sed -e limitation. * doc/autoconf.texi (Limitations of Usual Tools): Mention portability problem of sed -e option with script fragments. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 6e374992..52a7bb1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-18 Bruno Haible + + Document sed -e limitation. + * doc/autoconf.texi (Limitations of Usual Tools): Mention portability + problem of sed -e option with script fragments. + 2010-06-17 Ralf Wildenhues Document, test, and fix AT_ARG_OPTION, AT_ARG_OPTION_ARG. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index f6eb362a..eba61f49 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -18237,6 +18237,22 @@ but Posix says that this use of a semicolon has undefined effect if should use semicolon only with simple scripts that do not use these verbs. +The argument of the @option{-e} option must be a syntactically complete +script. GNU @command{sed} allows to pass multiple script fragments, +each as argument of a separate @option{-e} option, that are then combined, +with newlines between the fragments. A future Posix revision may allow +this as well. But in Posix:2008, this is not allowed, and the +@command{sed} programs on Solaris 10, HP-UX 11, and AIX don't allow it +either: + +@example +$ @kbd{echo a | sed -n -e 'i\} +@kbd{0'} +0 +$ @kbd{echo a | sed -n -e 'i\' -e 0} +Unrecognized command: 0 +@end example + Commands inside @{ @} brackets are further restricted. Posix says that they cannot be preceded by addresses, @samp{!}, or @samp{;}, and that each command must be followed immediately by a newline, without any