Funny csh output?

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Mar 2 14:14:31 AEST 1990


In article <6669 at cps3xx.UUCP> davisd at cpsvax.UUCP (Dug) writes:
-In article <12251 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
-#In article <6662 at cps3xx.UUCP> davisd at cpsvax.cps.msu.edu (Dug) writes:
-#>% jobs | wc
-#>       0       0       0
-#There are no suspended jobs in the shell that's running the pipeline
-#(it's a subprocess of the one that printed the prompt).
-But it that's true then why can I redirect it to a file and have my
-stopped jobs show up there?  (i.e.  jobs > test  will result in "test"
-having the correct output of jobs)

Because the shell doesn't find it necessary to set up a subshell in
that case; it runs the command with I/O redirected then jumps back to
the main command-processing loop.  The ways that shells decide when to
use subprocesses and when to short-cut them are rather complicated..



More information about the Comp.unix.questions mailing list