]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
ksh looses redirections on exec
authorStepan Kasal <kasal@ucw.cz>
Wed, 29 Jun 2005 10:36:04 +0000 (10:36 +0000)
committerStepan Kasal <kasal@ucw.cz>
Wed, 29 Jun 2005 10:36:04 +0000 (10:36 +0000)
ChangeLog
doc/autoconf.texi

index 0e194051fa7562a5ae90cb7eb0f1cd8fff39bcab..4b3ad6ada787a7f1f7eb526bdc427d2d2589e2e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-29  Stepan Kasal  <kasal@ucw.cz>
+
+       * doc/autoconf.texi (File Descriptors): ksh doesn't pass open file
+       descriptors to child processes; reported by Norman Gray.
+
 2005-06-29  Stepan Kasal  <kasal@ucw.cz>
 
        * lib/autoconf/general.m4 (AC_SUBST_TRACE): New macro, to be traced
index f2980175670866f079ff5aec837b7ff89fd2279c..2d155f3ac680c7a07997bad0e7c6a7aaec21bdd3 100644 (file)
@@ -10021,6 +10021,32 @@ good ones@enddots{}
 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
+@command{ksh}, file descriptors above 2 which are opened using
+@samp{exec 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:
+@example
+$ cat ./descrips
+#! /bin/sh -
+echo hello >&5
+$ exec 5>t
+$ ./descrips
+$ cat t
+hello
+$
+@end example
+But using ksh:
+@example
+$ exec 5>t
+$ ./descrips
+hello
+$ cat t
+$
+@end 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 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