]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Usual Tools, Limitations of
authorAkim Demaille <akim@epita.fr>
Fri, 26 May 2000 08:32:45 +0000 (08:32 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 26 May 2000 08:32:45 +0000 (08:32 +0000)
Builtins): Integrate comments from Paul Eggert and Jim Meyering.
Add the sed limitation discovered by Philippe De Muyter.
Typo from Pavel Roskin.

ChangeLog
doc/autoconf.texi

index b57115bafabd1635c60598fa063d457b09e3a7e6..1c52b0af13eb20dc12535104a477037e0005a512 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-05-26  Akim Demaille  <akim@epita.fr>
+
+       * doc/autoconf.texi (Limitations of Usual Tools, Limitations of
+       Builtins): Integrate comments from Paul Eggert and Jim Meyering.
+       Add the sed limitation discovered by Philippe De Muyter.
+       Typo from Pavel Roskin.
+
 2000-05-25  Akim Demaille  <akim@epita.fr>
 
        The test suite needs GNU m4.
index bafed6fcaa2aebe3fecc40667fc16919e2259adb..9cbf82f8b592bdd637e82587308e9b4b487c8879 100644 (file)
@@ -4611,7 +4611,7 @@ zsh-3.1.6 %
 (of course we could just @code{unset} @code{CDPATH}, it also behaves
 properly if set to the empty string).
 
-Life wouldn't be so much fun if @command{bash} abd @command{zsh} had the
+Life wouldn't be so much fun if @command{bash} and @command{zsh} had the
 same behavior:
 
 @example
@@ -4756,6 +4756,21 @@ bash-2.02$ case /tmp in [\\/]*) echo OK;; esac
 OK
 @end example
 
+@item @command{echo}
+@cindex @command{echo}
+The simple @code{echo} is probably the most surprising source of
+portability troubles.
+
+Don't expect any option.  @xref{Preset Output Variables}, @code{ECHO_N}
+etc. for a means to simulate @samp{-c}.
+
+Do not use backslashes in the arguments, as there is no consensus on
+their handling:
+
+On @samp{foo='\n'; echo "$foo" | wc -l}, the @command{sh} of Digital
+Unix 4.0, RISC/os 4.52, answer 2, but the Solaris' @command{sh}, Bash
+and Zsh (in @command{sh} emulation mode) report 1.
+
 @item @command{exit}
 @cindex @command{exit}
 Some shell scripts, such as those generated by @command{autoconf}, use a
@@ -4864,17 +4879,21 @@ faster:
 
 @example
 case $ac_feature in
-  *[^-a-zA-Z0-9_]*) @var{action};;
+  *[!-a-zA-Z0-9_]*) @var{action};;
 esac
 @end example
 
-Alas, negated character classes are not portable (some old shells
-support the @samp{[!...]} syntax, some modern shells such as
-@command{zsh} support only the more recent syntax @samp{[^...]}).  One
-solution can be:
+Alas, negated character classes are probably not portable, although no
+shell is known not to support the @sc{posix.2} syntax @samp{[!...]}
+(when in interactive mode, @command{zsh} is confused by the
+@samp{[!...]} syntax and looks for an event in its history because of
+@samp{!}).  Many shell do not support the alternative syntax
+@samp{[^...]} (Solaris, Digital Unix etc.).
+
+One solution can be:
 
 @example
-expr "$ac_feature" : ".*[^-a-zA-Z0-9_]" >/dev/null &&
+expr "$ac_feature" : '.*[^-a-zA-Z0-9_]' >/dev/null &&
   @var{action}
 @end example
 
@@ -4882,13 +4901,13 @@ expr "$ac_feature" : ".*[^-a-zA-Z0-9_]" >/dev/null &&
 or better yet
 
 @example
-expr "x$ac_feature" : ".*[^-a-zA-Z0-9_]" >/dev/null &&
+expr "x$ac_feature" : '.*[^-a-zA-Z0-9_]' >/dev/null &&
   @var{action}
 @end example
 
-It is somewhat more robust than the @samp{echo | grep} solution which
-suffers the limitations of @command{echo}: its argument should be too
-special (containing backslashes).
+@samp{expr "X@var{foo}" : "X@var{bar}"} is more robust than @samp{echo
+"X@var{foo}" | grep "^X@var{bar}"}, because it avoids problems when
+@samp{@var{foo}} contains backslashes.
 
 
 @item @command{unset}
@@ -4943,12 +4962,14 @@ foo
 
 @item @command{expr}
 @cindex @command{expr}
-Don't use @samp{\?}, @samp{\+} and @samp{\|} which are not supported by
-Solaris.
+Don't use @samp{\?}, @samp{\+} and @samp{\|} in patterns, they are
+not supported on Solaris.
+
+No @command{expr} keyword starts with @samp{x}, so use @samp{expr
+x"@var{word}" : '@var{regex}'} to keep @command{expr} from
+misinterpreting @var{word}.
 
-There is no known command of @command{expr} starting with @samp{x}, so
-using @samp{expr x"@var{word}" : '@var{regex}'} avoids problems if
-@var{word} happens to have a meaning for @command{expr}.
+Don't use @code{length}, @code{substr}, @code{match} and @code{index}.
 
 @item @command{grep}
 @cindex @command{grep}
@@ -4976,6 +4997,9 @@ and should not contain comments.
 @code{sed} have an input buffer limited to 4000 bytes.
 
 Alternation, @samp{\|}, is common but not portable.
+
+Nested groups are extremely portable, but there is at least one sed
+(System V/68 Base Operating System R3V7.1) which does not support it.
 @end table