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

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



Vincent Lefevre wrote:
> But with bash for instance, both
> 
>   jobs | cat
> 
> and
> 
>   true | jobs
> 
> work. So, it seems that jobs still works even in a child process.
> The same thing that 4.1 does?

It certainly looks like a similar hack of some sorts.  None of

   true | { jobs; }
   true | ( jobs; )
   function j { jobs; }; true | j

produce any output in the version of bash we have here (which probably isn't
up to date).  It so happens that with the hack we use, the special
case survives for the equivalent code on the left hand side of the pipe,
but a hack is a hack...

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


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************




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