Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: `jobs | wc -l' => 0 ... bug?



On Mar 26,  3:29pm, Peter Stephenson wrote:
} Subject: Re: `jobs | wc -l' => 0 ... bug?
}
} > $ jobs | wc -l
} >       0
} 
} jobs here runs in a subshell, where there is no job control, so no
} information on jobs.  It has always been this way.  It's not particularly
} convenient, however.  Maybe it's time someone thought about changing it.

What do you suggest, that we special-case the "jobs" command?

Zsh runs the left-hand-side of pipelines in a subshell and the right-
hand-side in a current shell so that stuff like

	echo foo | read line
	echo $line

will output "foo".  Bash (I believe) runs the right-hand-side in a subshell
and the left in the current shell.  I like zsh's way better.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author