From: Paul Eggert Date: Fri, 30 Jul 2004 00:34:27 +0000 (+0000) Subject: (Shellology): Document problem with "`""`" in pdksh POSIX mode. X-Git-Tag: AUTOCONF-2.59c~668 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5406443202a3bbf4cd2ec7a02614eff440def559;p=thirdparty%2Fautoconf.git (Shellology): Document problem with "`""`" in pdksh POSIX mode. --- diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 5f8019973..0f6df777a 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -9332,7 +9332,7 @@ Below we describe some of the members of the Bourne shell family. @table @asis @item Ash @cindex Ash -@command{ash} is often used on @acronym{GNU}/Linux and @acronym{BSD} +Ash is often used on @acronym{GNU}/Linux and @acronym{BSD} systems as a light-weight Bourne-compatible shell. Ash 0.2 has some bugs that are fixed in the 0.3.x series, but portable shell scripts should work around them, since version 0.2 is still shipped with many @@ -9366,7 +9366,7 @@ Substitutions}, item ``Command Substitution''. @item Bash @cindex Bash -To detect whether you are running @command{bash}, test whether +To detect whether you are running Bash, test whether @code{BASH_VERSION} is set. To require @acronym{POSIX} compatibility, run @samp{set -o posix}. @xref{Bash POSIX Mode,, Bash @acronym{POSIX} Mode, bash, The @acronym{GNU} Bash Reference @@ -9374,12 +9374,12 @@ Manual}, for details. @item Bash 2.05 and later @cindex Bash 2.05 and later -Versions 2.05 and later of @command{bash} use a different format for the +Versions 2.05 and later of Bash use a different format for the output of the @command{set} builtin, designed to make evaluating its output easier. However, this output is not compatible with earlier -versions of @command{bash} (or with many other shells, probably). So if -you use @command{bash} 2.05 or higher to execute @command{configure}, -you'll need to use @command{bash} 2.05 for all other build tasks as well. +versions of Bash (or with many other shells, probably). So if +you use Bash 2.05 or higher to execute @command{configure}, +you'll need to use Bash 2.05 for all other build tasks as well. @item Ksh @cindex Ksh @@ -9394,15 +9394,6 @@ release. It is usually called @command{ksh}, but is called @command{sh} on some hosts if you set your path appropriately. @itemize @minus -@item -@prindex @samp{pdksh} -A public-domain clone of the Korn shell called @samp{pdksh} is -widely available: it has most of the @samp{ksh88} features along with -a few of its own. -Similarly to @command{bash}, you can detect whether you are running -@samp{pdksh} by testing whether @code{KSH_VERSION} is set, and you can -require @acronym{POSIX} compatibility by running @samp{set -o posix}. - @item Solaris systems have three variants: @prindex @command{/usr/bin/ksh} on Solaris @@ -9425,6 +9416,30 @@ the standard shell conform to @acronym{POSIX}. @end itemize +@item Pdksh +@prindex @samp{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. Similarly to Bash, you can detect whether you are +running @command{pdksh} by testing whether @code{KSH_VERSION} is set, +and you can require @acronym{POSIX} compatibility by running @samp{set +-o posix}. Unfortunately, with @command{pdksh} 5.2.14 (the latest +stable version as of July 2004) @acronym{POSIX} mode is buggy and causes +@command{pdksh} to depart from @acronym{POSIX} in at least one respect: + +@example +$ echo "`echo \"hello\"`" +hello +$ set -o posix +$ echo "`echo \"hello\"`" +"hello" +@end example + +The last line of output contains spurious quotes. This is yet another +reason why portable shell code should not contain +@code{"`@dots{}\"@dots{}\"@dots{}`"} constructs (@pxref{Shell +Substitutions}). + @item Zsh @cindex Zsh To detect whether you are running @command{zsh}, test if @@ -9502,7 +9517,7 @@ bash-2.04$ @kbd{cat <