[comp.bugs.4bsd] 4.3BSD csh: piping into subshells sometimes loses

jtkohl@athena.mit.edu (John T Kohl) (12/16/88)

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@ATHENA.MIT.EDU>
Digital Equipment Corporation/MIT Project Athena
(As usual, the opinions expressed above do not necessarily reflect the
opinions of my employer. :-)