Someone has reported this interesting "feature" of csh and tcsh, and
I've confirmed it; I wonder if anyone has any thoughts on this, most
particularly ways to avoid it.
It seems that if you have a program, and it opens some file descriptors
(in my case, a regular pipe), then you fork/exec either a csh or tcsh
script, that csh/tcsh will _close_ your file descriptors (note they
are _not_ marked as close on exec--the same sequence works fine with
Bourne shells).
I note that Tom Christiansen's "Csh Programming Considered Harmful"
says:
The csh has also been known to close all open file descriptors besides
the ones it knows about, making it unsuitable for applications that
intend to inherit open file descriptors.
which tends to confirm my observations (I tested with csh from Solaris
7, and tcsh 6.09.03 from my Debian GNU/Linux distro).
Does anyone know of a way to _stop_ C shells from doing this?
Personally, I'm happy to tell people to not use C shell, but if there is
a way to fix this I feel I have an obligation to share it :).
--
---------------------------------------------------------------------------
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist