Ralf Wildenhues <[EMAIL PROTECTED]> writes:
> | @example
> | sed -e @var{instruction-1} \
> | -e @var{instruction-2}
> | @end example
>
> is not equivalent to
>
> | @example
> | sed @var{instruction-1};@var{instruction-2}
> | @end example
>
> everywhere.
Thanks for reporting that. I installed this fix:
2005-01-03 Paul Eggert <[EMAIL PROTECTED]>
* doc/autoconf.texi (Limitations of Usual Tools): Warn about
sed 'command1;command2'. Problem reported by Ralf Wildenhues.
Index: autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.859
retrieving revision 1.860
diff -p -u -r1.859 -r1.860
--- autoconf.texi 3 Jan 2005 07:35:21 -0000 1.859
+++ autoconf.texi 3 Jan 2005 08:31:44 -0000 1.860
@@ -11799,23 +11799,37 @@ Nested parenthesization in patterns (e.g
quite portable to modern hosts, but is not supported by some older
@command{sed} implementations like SVR3.
-Of course the option @option{-e} is portable, but it is not needed. No
-valid Sed program can start with a dash, so it does not help
-disambiguating. Its sole usefulness is to help enforcing indentation as
-in:
+The @option{-e} option is portable.
+Some people prefer to use it:
@example
-sed -e @var{instruction-1} \
- -e @var{instruction-2}
+sed -e '@var{command-1}' \
+ -e '@var{command-2}'
@end example
@noindent
-as opposed to
+as opposed to the equivalent:
@example
-sed @var{instruction-1};@var{instruction-2}
+sed '
+ @var{command-1}
+ @var{command-2}
+'
@end example
[EMAIL PROTECTED]
+The following usage is sometimes equivalent:
+
[EMAIL PROTECTED]
+sed '@var{command-1};@var{command-2}'
[EMAIL PROTECTED] example
+
+but Posix says that this use of a semicolon has undefined effect if
[EMAIL PROTECTED]'s verb is @[EMAIL PROTECTED], @samp{a}, @samp{b}, @samp{c},
[EMAIL PROTECTED], @samp{r}, @samp{t}, @samp{w}, @samp{:}, or @samp{#}, so you
+should use semicolon only with simple scripts that do not use these
+verbs.
+
Contrary to yet another urban legend, you may portably use @samp{&} in
the replacement part of the @code{s} command to mean ``what was
matched''. All descendants of Unix version 7 @command{sed}
_______________________________________________
Autoconf mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/autoconf