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

Re: zsh: Strange feature with 'jobs' commmand



On 30 May, you wrote:
> 
> If you start a few jobs in the background and do:
> zsh% jobs
> [1]  - running    xmixer
> [2]  + running    gtcd
> zsh% _
> 
> ok, this is expected but this is not...
> zsh% jobs | less
> (END)
> zsh% _
> 
> Why? This is quite annoying. You do not get any output if you pipe the
> results from the "jobs" command. (jobs 2>&1|less doesn't work either)

What is happening is that jobs is being run in a subshell. The subshell
doesn't inherit the child processes (i.e. the jobs) so when jobs runs it
doesn't find any to list.

We could do with a mention of this in the FAQ (unless it is there
already and my quick grep missed it).

Incidentally, I think bash special cases the jobs builtin and would
run less in a subshell in this case instead. Could we do something like
this in zsh?

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



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