Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: why does "jobs | wc" not work?
- X-seq: zsh-users 5520
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: why does "jobs | wc" not work?
- Date: Tue, 26 Nov 2002 11:56:58 +0100
- In-reply-to: <20021126104930.GE1937@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20021126104930.GE1937@xxxxxx>
In article <20021126104930.GE1937@xxxxxx>,
Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> There seems to be a strange bug with the jobs command in
> zsh-4.0.4. It seems that the output of the jobs command refuses
> to go into a pipe.
> This works:
> $ sleep 1000 &
> [1] 6262
> $ jobs > foo
> $ wc foo
> 1 5 29 foo <--
> But this does not:
> $ sleep 1000 &
> [1] 6262
> $ jobs | wc
> 0 0 0 <-- ?
> And also:
> $ echo `jobs`
> $
> Is there a specific reason why jobs generates no output when
> running in a pipe?
Because jobs is executed in a subshell?
This is not the case with jobs > foo. "true | jobs" is also OK.
> Note: In pdksh and bash (as bash and sh), jobs works as I would
> expect; csh and tcsh work like zsh.
AFAIK, shells do not implement the pipe and jobs in the same way.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author