"Gary V. Vaughan" <[EMAIL PROTECTED]> writes: > I think autoconf should test for that bug and skip a shell that has it when > searching for a suitable shell...
The Autoconf manual states that portable shell scripts should never use "`...\"...\"...`" constructs due to severe portability constructs, so it doesn't seem wise for Autoconf to test for that bug (it sounds like it would eliminate too many shells :-). I installed the following doc patch to warn about this, though. This patch also cleans up some naming/quoting glitches, so you'll have to scan for "pdksh" to see the meat. 2004-07-29 Paul Eggert <[EMAIL PROTECTED]> * doc/autoconf.texi (Shellology): Mention BIN_SH. Document problem with "`""`" in pdksh POSIX mode. Index: autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.824 retrieving revision 1.825 diff -p -u -r1.824 -r1.825 --- autoconf.texi 29 Jul 2004 22:29:16 -0000 1.824 +++ autoconf.texi 30 Jul 2004 00:34:27 -0000 1.825 @@ -9332,7 +9332,7 @@ Below we describe some of the members of @table @asis @item Ash @cindex Ash [EMAIL PROTECTED] 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 Substitut @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 @@ -9395,15 +9395,6 @@ on some hosts if you set your path appro @itemize @minus @item [EMAIL PROTECTED] @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 [EMAIL PROTECTED] by testing whether @code{KSH_VERSION} is set, and you can -require @acronym{POSIX} compatibility by running @samp{set -o posix}. - [EMAIL PROTECTED] Solaris systems have three variants: @prindex @command{/usr/bin/ksh} on Solaris @command{/usr/bin/ksh} is @samp{ksh88}, @@ -9425,6 +9416,30 @@ the standard shell conform to @acronym{P @end itemize [EMAIL PROTECTED] Pdksh [EMAIL PROTECTED] @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 [EMAIL PROTECTED] to depart from @acronym{POSIX} in at least one respect: + [EMAIL PROTECTED] +$ echo "`echo \"hello\"`" +hello +$ set -o posix +$ echo "`echo \"hello\"`" +"hello" [EMAIL PROTECTED] example + +The last line of output contains spurious quotes. This is yet another +reason why portable shell code should not contain [EMAIL PROTECTED]"[EMAIL PROTECTED]"@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 <<EOF Many older shells (including the Bourne shell) implement here-documents inefficiently. And some shells mishandle large here-documents: for example, Solaris 8 @command{dtksh}, which is derived from [EMAIL PROTECTED] M-12/28/93d, mishandles variable expansion that occurs +Korn shell version M-12/28/93d, mishandles variable expansion that occurs on 1024-byte buffer boundaries within a here-document. Users can generally fix these problems by using a faster or more reliable shell, e.g., by using the command @samp{bash ./configure} rather than @@ -10336,7 +10351,7 @@ your script might be suspended waiting f @evindex PS4 These variables should not matter for shell scripts, since they are supposed to affect only interactive shells. However, at least one -shell (the pre-3.0 @sc{uwin} @command{ksh}) gets confused about +shell (the pre-3.0 @sc{uwin} Korn shell) gets confused about whether it is interactive, which means that (for example) a @env{PS1} with a side effect can unexpectedly modify @samp{$?}. To work around this bug, Autoconf-generated scripts do something like this: @@ -10372,8 +10387,8 @@ variable accordingly. On DJGPP systems, the @code{PATH_SEPARATOR} environment variable can be set to either @samp{:} or @samp{;} to control the path separator [EMAIL PROTECTED] uses to set up certain environment variables (such as [EMAIL PROTECTED]). Since this only works inside @command{bash}, you want +Bash uses to set up certain environment variables (such as [EMAIL PROTECTED]). Since this only works inside Bash, you want @command{configure} to detect the regular @acronym{DOS} path separator (@samp{;}), so it can be safely substituted in files that may not support @samp{;} as path separator. So it is recommended to either unset this @@ -10472,7 +10487,7 @@ You don't need to quote the argument; no You don't need the final @samp{;;}, but you should use it. -Because of a bug in its @code{fnmatch}, @command{bash} fails to properly +Because of a bug in its @code{fnmatch}, Bash fails to properly handle backslashes in character classes: @example @@ -10694,7 +10709,7 @@ fi @c ------------------ @prindex @command{printf} A format string starting with a @samp{-} can cause problems. [EMAIL PROTECTED] (eg. 2.05b) will interpret it as an options string and +Bash (eg. 2.05b) will interpret it as an options string and give an error. And @samp{--} to mark the end of options is not good in the NetBSD Almquist shell (eg. 0.4.6) which will take that literally as the format string. Putting the @samp{-} in a @samp{%c} _______________________________________________ Libtool mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/libtool