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

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



Peter Stephenson wrote:

> > 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.

But in zsh one can do that faster with ${#jobdirs} (or jobstates or
jobtexts) anyway.  After the parameter module is loaded.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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