From: Eric Blake Date: Thu, 5 May 2011 14:29:21 +0000 (-0600) Subject: doc: document dash bug with positional parameters X-Git-Tag: v2.68b~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2105ae97000c7c77442b3a788c90d8fee63bd2b3;p=thirdparty%2Fautoconf.git doc: document dash bug with positional parameters * doc/autoconf.texi (Shell Substitutions) <${10}>: Document a pitfall with $10. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 14abf514..1fca7bbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-05 Eric Blake + + doc: document dash bug with positional parameters + * doc/autoconf.texi (Shell Substitutions) <${10}>: Document + a pitfall with $10. + 2011-04-27 Eric Blake docs: document NetBSD join bug diff --git a/doc/autoconf.texi b/doc/autoconf.texi index b466e560..7ff693f5 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -15846,6 +15846,18 @@ $ @kbd{echo $@{10@}} bad substitution @end example +Conversely, not all shells obey the Posix rule that when braces are +omitted, multiple digits beyond a @samp{$} imply the single-digit +positional parameter expansion concatenated with the remaining literal +digits. To work around the issue, you must use braces. + +@example +$ @kbd{bash -c 'set a b c d e f g h i j; echo $10 $@{1@}0'} +a0 a0 +$ @kbd{dash -c 'set a b c d e f g h i j; echo $10 $@{1@}0'} +j a0 +@end example + @item $@{@var{var}:-@var{value}@} @c Info cannot handle `:' in index entries. @ifnotinfo