Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Funny csh output? Message-ID: <12263@smoke.BRL.MIL> Date: 2 Mar 90 03:14:31 GMT References: <6662@cps3xx.UUCP> <12251@smoke.BRL.MIL> <6669@cps3xx.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <6669@cps3xx.UUCP> davisd@cpsvax.UUCP (Dug) writes: -In article <12251@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: -#In article <6662@cps3xx.UUCP> davisd@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..