From: Ralf Wildenhues Date: Tue, 22 Jun 2010 18:05:38 +0000 (+0200) Subject: Clarify nested double-quotes and backquotes shell issues. X-Git-Tag: v2.66~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bba5963d58eea7424e7e5438651c054e5da8241b;p=thirdparty%2Fautoconf.git Clarify nested double-quotes and backquotes shell issues. * doc/autoconf.texi (Shellology): New anchor for pdksh. (Shell Substitutions): Link to it for escaped double-quotes within double-quoted backquotes; add ksh example for unescaped inner double-quotes problem. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index df492a02..0fc8dbe8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-06-22 Ralf Wildenhues + Clarify nested double-quotes and backquotes shell issues. + * doc/autoconf.texi (Shellology): New anchor for pdksh. + (Shell Substitutions): Link to it for escaped double-quotes + within double-quoted backquotes; add ksh example for unescaped + inner double-quotes problem. + Mention Tru64 5.1 fgrep limitation with emtpy patterns. * doc/autoconf.texi (Limitations of Usual Tools): Update. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index c2772fe4..7e97d964 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -14626,6 +14626,7 @@ the standard shell conform to Posix. @item Pdksh @prindex @samp{pdksh} +@anchor{pdksh} A public-domain clone of the Korn shell called @command{pdksh} is widely available: it has most of the @samp{ksh88} features along with a few of its own. It usually sets @code{KSH_VERSION}, except if invoked as @@ -15139,9 +15140,18 @@ esac @noindent and in fact it is even @emph{more} portable: in the first case of the first attempt, the computation of @code{top_srcdir} is not portable, -since not all shells properly understand @code{"`@dots{}"@dots{}"@dots{}`"}. +since not all shells properly understand @code{"`@dots{}"@dots{}"@dots{}`"}, +for example Solaris 10 ksh: + +@example +$ @kbd{foo="`echo " bar" | sed 's, ,,'`"} +ksh: : cannot execute +ksh: bar | sed 's, ,,': cannot execute +@end example + +@noindent Worse yet, not all shells understand @code{"`@dots{}\"@dots{}\"@dots{}`"} -the same way. There is just no portable way to use double-quoted +the same way (@pxref{pdksh}). There is just no portable way to use double-quoted strings inside double-quoted back-quoted expressions (pfew!). @table @code