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

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



Dominik Vogt wrote:
> From a user's point of view I think it would be better to fork the
> right hand side of the pipe.  This way, the left hand side always
> generates the same output, regardless of the context in which it
> is used.

If you look in the completion system, you will see various places where
we do stuff on the lines of

  output_some_values | while read line; ...

in order to process values for the current shell, and very few where we
need to output transient data from shell builtins.  I think jobs is the
only common case.

> In my eyes,
> the real flaw lies in the design of the jobs command.  Commands
> printing information about the current shell should not rely on
> design choices inherent to the shell.

Surely that's the one thing they have got to rely on :-).

The basic problem is that job control relies on the process structure of
UNIX.  There is no way this can be completely hidden from the user, nor
should it be or it will be useless for its job of dealing with multiple
processes efficiently.

I agree it could have been better documented, it's not at all obvious
without some prior knowledge of the architecture.

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