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

Re: why does "jobs | wc" not work?



On Tue, Nov 26, 2002 at 02:33:33PM +0100, Dominik Vogt wrote:

>   jobs > x; I=0; while read X; do I=$[I+1]; done < x; echo $I
> 
> Can anyone think of a more efficient way (speed does matter here)?

Assuming you have a recent enough version of zsh (4.0.x has it, but I'm
not sure when it was introduced):

    echo $#jobstates

$jobdirs and $jobtexts are also available.  They're in the zsh/parameter
module if you don't already have it loaded.

Danek




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