docs: mention Solaris here-docs vs. ${a-"b c"}

* doc/autoconf.texi (Shell Substitutions) <${var:=value}>:
Document problem of "" within here-docs.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2010-08-30 11:11:32 -06:00
parent 30378453ea
commit 2626155d5c
2 changed files with 29 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2010-08-30 Eric Blake <eblake@redhat.com> 2010-08-30 Eric Blake <eblake@redhat.com>
docs: mention Solaris here-docs vs. ${a-"b c"}
* doc/autoconf.texi (Shell Substitutions) <${var:=value}>:
Document problem of "" within here-docs.
Reported by Ralf Wildenhues.
fortran: always avoid AC_LANG_CONFTEST warning fortran: always avoid AC_LANG_CONFTEST warning
* lib/autoconf/lang.m4 (AC_LANG_CONFTEST()): Make the default * lib/autoconf/lang.m4 (AC_LANG_CONFTEST()): Make the default
match the fact that the default AC_LANG_SOURCE does not inline match the fact that the default AC_LANG_SOURCE does not inline

View File

@ -15466,7 +15466,8 @@ use null variable substitution patterns in configure scripts.
@cindex $@{@var{var}+@var{value}@} @cindex $@{@var{var}+@var{value}@}
When using @samp{$@{@var{var}-@var{value}@}} or When using @samp{$@{@var{var}-@var{value}@}} or
@samp{$@{@var{var}-@var{value}@}} for providing alternate substitutions, @samp{$@{@var{var}-@var{value}@}} for providing alternate substitutions,
@var{value} must either be a single shell word or be quoted. Solaris @var{value} must either be a single shell word, quoted, or in the
context of an unquoted here-document. Solaris
@command{/bin/sh} complains otherwise. @command{/bin/sh} complains otherwise.
@example @example
@ -15476,12 +15477,17 @@ $ @kbd{/bin/sh -c 'echo $@{a-'\''b c'\''@}'}
b c b c
$ @kbd{/bin/sh -c 'echo "$@{a-b c@}"'} $ @kbd{/bin/sh -c 'echo "$@{a-b c@}"'}
b c b c
$ @kbd{/bin/sh -c 'cat <<EOF
$@{a-b c@}
EOF}
b c
@end example @end example
According to Posix, if an expansion occurs inside double quotes, then According to Posix, if an expansion occurs inside double quotes, then
the use of unquoted double quotes within @var{value} is unspecified, and the use of unquoted double quotes within @var{value} is unspecified, and
any single quotes become literal characters; in that case, escaping must any single quotes become literal characters; in that case, escaping must
be done with backslash. be done with backslash. Likewise, the use of unquoted here-documents is
a case where double quotes have unspecified results:
@example @example
$ @kbd{/bin/sh -c 'echo "$@{a-"b c"@}"'} $ @kbd{/bin/sh -c 'echo "$@{a-"b c"@}"'}
@ -15498,6 +15504,22 @@ $ @kbd{/bin/sh -c 'a=; echo "$@{a+\"b c\"@}"'}
"b c" "b c"
$ @kbd{/bin/sh -c 'a=; echo "$@{a+b c@}"'} $ @kbd{/bin/sh -c 'a=; echo "$@{a+b c@}"'}
b c b c
$ @kbd{/bin/sh -c 'cat <<EOF
$@{a-"b c"@}
EOF'}
"b c"
$ @kbd{/bin/sh -c 'cat <<EOF
$@{a-'b c'@}
EOF'}
'b c'
$ @kbd{bash -c 'cat <<EOF
$@{a-"b c"@}
EOF'}
b c
$ @kbd{bash -c 'cat <<EOF
$@{a-'b c'@}
EOF'}
'b c'
@end example @end example
Perhaps the easiest way to work around quoting issues in a manner Perhaps the easiest way to work around quoting issues in a manner