4.3BSD csh: piping into subshells sometimes loses
John T Kohl
jtkohl at athena.mit.edu
Sat Dec 17 00:35:18 AEST 1988
Index: bin/csh 4.3BSD
Description:
Output piped into a subshell starting a backgrounded process works when
in an interactive shell, but not when in a shell script.
The same script, when run directly and executed as csh -f <filename>, fails,
while it works when source'd.
The manual page says nothing relevant about pipes into subshells.
Repeat-By:
prompt% /bin/csh -f
% cat /tmp/foo.csh
#!/bin/csh -f
echo foo bar baz |(tee /tmp/foobar &)
exit 0
% source /tmp/foo.csh
foo bar baz
% cat /tmp/foobar
foo bar baz
% rm /tmp/foobar
% /tmp/foo.csh
% cat /tmp/foobar
% rm /tmp/foobar
% /bin/csh -f /tmp/foo.csh
% cat /tmp/foobar
% exit
John Kohl <jtkohl at ATHENA.MIT.EDU>
Digital Equipment Corporation/MIT Project Athena
(As usual, the opinions expressed above do not necessarily reflect the
opinions of my employer. :-)
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list