autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] tests: fix spurious failure due to Solaris XPG4 sh bug


From: Paul Eggert
Subject: Re: [PATCH] tests: fix spurious failure due to Solaris XPG4 sh bug
Date: Sun, 04 Mar 2012 09:54:29 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 03/04/2012 08:16 AM, Stefano Lattarini wrote:
> What's going on there?

That is a bug in older ksh implementations.
I've pushed the following doc patch to describe it.
I don't fully understand your test case, but renaming
"script" to "script2" won't work if there happens to
be a command named "script2" in the path, so I suggest
changing the file name back to "script" but invoking
it as "./script", which should work around the ksh bug.

[PATCH] doc: mention PATH bug with "ksh foo"

* doc/autoconf.texi (Invoking the Shell): Mention ksh PATH bug.
---
 doc/autoconf.texi |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index da34a4e..9442e22 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15219,6 +15219,22 @@ Bash in Mac OS X 10.2.
 @cindex invoking the shell
 @cindex shell invocation
 
+The Korn shell (up to at least version M-12/28/93d) has a bug when
+invoked on a file whose name does not contain a slash.  It first
+searches for the file's name in @env{PATH}, and if found it executes
+that rather than the original file.  For example, assuming there is a
+binary executable @file{/usr/bin/script} in your @env{PATH}, the last
+command in the following example fails because the Korn shell finds
address@hidden/usr/bin/script} and refuses to execute it as a shell script:
+
address@hidden
+$ @kbd{touch xxyzzyz script}
+$ @kbd{ksh xxyzzyz}
+$ @kbd{ksh ./script}
+$ @kbd{ksh script}
+ksh: script: cannot execute
address@hidden example
+
 Bash 2.03 has a bug when invoked with the @option{-c} option: if the
 option-argument ends in backslash-newline, Bash incorrectly reports a
 syntax error.  The problem does not occur if a character follows the
-- 
1.7.6.5




reply via email to

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