Hello,

On Thu, Jun 02, 2005 at 04:32:30PM +0200, Norman Gray wrote:
> May I suggest the following patch to the `Portable Shell Programming' 
> section of autoconf.texi?

I commited your patch to the CVS, as attached to this mail. Thanks.

> On Tru64 at least, ./configure scripts will 
> prefer ksh to /bin/sh because the latter doesn't implement $LINENO 
> properly (is that _really_ so important, says he plaintively...?)

No, it's not so important.  But it might be dangerous to touch the shell
selection routine without breaking it for some platform.
Perhaps even your Tru64 sh has some limitations which ksh doesn't have.

If you feel brave, try to submit a patch to improve the shell selection. ;-)

Stepan Kasal
2005-06-29  Stepan Kasal  <[EMAIL PROTECTED]>

        * doc/autoconf.texi (File Descriptors): ksh doesn't pass open file
        descriptors to child processes; reported by Norman Gray.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.919
diff -u -r1.919 autoconf.texi
--- doc/autoconf.texi   28 Jun 2005 13:08:29 -0000      1.919
+++ doc/autoconf.texi   29 Jun 2005 10:34:42 -0000
@@ -10021,6 +10021,32 @@
 Don't try to move/delete open files, such as in @samp{exec >foo; mv foo
 bar}; see @ref{Limitations of Builtins}, @command{mv} for more details.
 
+Don't rely on open file descriptors being open in child processes.  In
[EMAIL PROTECTED], file descriptors above 2 which are opened using
[EMAIL PROTECTED] n>file} are closed by a subsequent @samp{exec} (such as
+that involved in the fork-and-exec which runs a program or script).
+Thus, using sh, we have:
[EMAIL PROTECTED]
+$ cat ./descrips
+#! /bin/sh -
+echo hello >&5
+$ exec 5>t
+$ ./descrips
+$ cat t
+hello
+$
[EMAIL PROTECTED] example
+But using ksh:
[EMAIL PROTECTED]
+$ exec 5>t
+$ ./descrips
+hello
+$ cat t
+$
[EMAIL PROTECTED] example
+Within the process which runs the @samp{descrips} script, file
+descriptor number 5 is closed.
+
 @node File System Conventions
 @section File System Conventions
 @cindex File system conventions
@@ -13048,7 +13074,7 @@
 cp bar.x bar.y
 cp: cannot stat `bar.x': No such file or directory
 *** Error code 1
-% @kbd{tmake}       # True64 make
+% @kbd{tmake}       # Tru64 make
 cp ../bar.x bar.y
 @end example
 

Reply via email to