mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-17 14:01:27 +08:00
ksh looses redirections on exec
This commit is contained in:
parent
1b9326bc9e
commit
8b91927a02
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user