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

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



> From: neonatus@xxxxxxxxxxxx (Bostjan Muller)
> jobs | wc -l | tr -d " "
> but in zsh wc does not seem to get any input:
> $ jobs
> [1]  - suspended  mc
> [3]  + suspended  mc
> 
> $ 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.

The only workaround is to use a temporary file for output.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



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