Excerpts from linux-config: 9-Dec-98 pipe behavior differs: Linu.. Scott
McDermott@frontier (780*) 

> I cannot: 
>       jobs | grep pattern 

I'm guessing that Linux is starting the 'jobs' call in a new process,
because it's the first process in a pipeline.  I know the csh on AIX
behaves in this fashion, though I'm somewhat confused why bash behavior
differs between the platforms.  The ksh and sh shells on AIX don't
behave this way. 

Here's the csh example on AIX -- note the 'jobs | grep sleep' output is empty: 
    % sleep 20 & 
    [1] 39314 
    % jobs 
    [1]  + Running              sleep 20 
    % jobs | grep sleep 
    % jobs > /tmp/xyz; grep sleep /tmp/xyz 
    [1]  + Running              sleep 20 
    %  
    [1]    Done                 sleep 20 

For balance, here's the sh version on AIX: 
    % /bin/sh 
    $ sleep 20 & 
    [1] 39584 
    $ jobs 
    [1] +  Running                 sleep 20 & 
    $ jobs | grep sleep 
    [1] +  Running                 sleep 20 & 
    $ 

  ___   _           Blair Wyman                  IBM Rochester 
 ( /_)  /  _  ' _   (507)253-2891           [EMAIL PROTECTED] 
__/__)_/_<_/_/_/_'  Opinions expressed may not be those of IBM. 

Reply via email to