]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document dash ${*-unset} behavior
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 5 Feb 2016 22:15:07 +0000 (14:15 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 5 Feb 2016 22:15:38 +0000 (14:15 -0800)
* doc/autoconf.texi (Shell Substitutions): Document dash
incompatibility.  Problem reported by David Caldwell in:
http://bugs.gnu.org/22556

doc/autoconf.texi

index 9eac07baccd2b1e8e8a99e812c91119aac55f329..b288d59d2cb53ec7819b9e7b9993de8e4d3802ac 100644 (file)
@@ -16063,7 +16063,8 @@ j a0
 @cindex @code{$@{@var{var}-@var{value}@}}
 Old BSD shells, including the Ultrix @code{sh}, don't accept the
 colon for any shell substitution, and complain and die.
-Similarly for $@{@var{var}:=@var{value}@}, $@{@var{var}:?@var{value}@}, etc.
+Similarly for @code{$@{@var{var}:=@var{value}@}},
+@code{$@{@var{var}:?@var{value}@}}, etc.
 However, all shells that support functions allow the use of colon in
 shell substitution, and since m4sh requires functions, you can portably
 use null variable substitution patterns in configure scripts.
@@ -16089,6 +16090,18 @@ EOF}
 b c
 @end example
 
+Most shells treat the special parameters @code{*} and @code{@@} as being
+unset if there are no positional parameters.  However, some shells treat
+them as being set to the empty string.  Posix does not clearly specify
+either behavior.
+
+@example
+$ @kbd{bash -c 'echo "* is $@{*-unset@}."'}
+* is unset.
+$ @kbd{dash -c 'echo "* is $@{*-unset@}."'}
+* is .
+@end example
+
 According to Posix, if an expansion occurs inside double quotes, then
 the use of unquoted double quotes within @var{value} is unspecified, and
 any single quotes become literal characters; in that case, escaping must