autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: [PATCH] docs: mention Solaris here-docs vs. ${a-"b c"}
Date: Mon, 30 Aug 2010 11:15:58 -0600

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

Signed-off-by: Eric Blake <address@hidden>
---

Thanks again to Ralf for reporting this.

 ChangeLog         |    5 +++++
 doc/autoconf.texi |   26 ++++++++++++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5d3ac87..7068a19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-08-30  Eric Blake  <address@hidden>

+       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
        * lib/autoconf/lang.m4 (AC_LANG_CONFTEST()): Make the default
        match the fact that the default AC_LANG_SOURCE does not inline
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 840b4fe..b5b9ef3 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15466,7 +15466,8 @@ Shell Substitutions
 @cindex address@hidden@address@hidden@}
 When using @address@hidden@address@hidden@}} or
 @address@hidden@address@hidden@}} for providing alternate substitutions,
address@hidden must either be a single shell word or be quoted.  Solaris
address@hidden must either be a single shell word, quoted, or in the
+context of an unquoted here-document.  Solaris
 @command{/bin/sh} complains otherwise.

 @example
@@ -15476,12 +15477,17 @@ Shell Substitutions
 b c
 $ @kbd{/bin/sh -c 'echo "address@hidden address@hidden"'}
 b c
+$ @kbd{/bin/sh -c 'cat <<EOF
address@hidden address@hidden
+EOF}
+b c
 @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
-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
 $ @kbd{/bin/sh -c 'echo "address@hidden"b  c"@}"'}
@@ -15498,6 +15504,22 @@ Shell Substitutions
 "b  c"
 $ @kbd{/bin/sh -c 'a=; echo "address@hidden  address@hidden"'}
 b  c
+$ @kbd{/bin/sh -c 'cat <<EOF
address@hidden"b  c"@}
+EOF'}
+"b  c"
+$ @kbd{/bin/sh -c 'cat <<EOF
address@hidden'b  c'@}
+EOF'}
+'b  c'
+$ @kbd{bash -c 'cat <<EOF
address@hidden"b  c"@}
+EOF'}
+b  c
+$ @kbd{bash -c 'cat <<EOF
address@hidden'b  c'@}
+EOF'}
+'b  c'
 @end example

 Perhaps the easiest way to work around quoting issues in a manner
-- 
1.7.2.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]