Uh, unless you jave a differend 'jobs' than I do...

[lordvadr ~]$ ftp
ftp> ^Z
[1]+  Stopped                 ftp
[lordvadr ~]$ jobs
[1]+  Stopped                 ftp
[lordvadr ~]$ jobs | grep ftp
[1]+  Stopped                 ftp

If for whatever reason your jobs prints to stderr, then you would say..

jobs 2>&1 |grep pattern

Just for the record, do you have any stopped or background jobs?

-CJO-

On Wed, 9 Dec 1998, Scott McDermott wrote:

>Under AIX, stdout from the bash builtin `jobs' can be piped arbitrarily
>(to a pager, to grep, what have you).  Under Linux, it seems that I
>can't do this; the pipe comes up empty.  I can:
>
>       jobs >thisfile; grep pattern thisfile
>
>but I cannot:
>
>       jobs | grep pattern
>
>although either works under AIX.  The shell is the same for both
>environments.  I have invoked them with --noprofile and --norc in order
>to rule out some kind of setting which makes the pipes behave
>differently.
>
>Does anyone know why bash behaves differently under AIX? And why I can't
>do this with Linux? (2.0.36, egcs-1.0.3a, glibc-2.0.6, bash-2.02.1).  I
>really would like to be able to parse this output for a script I'm
>trying to write.  I'm also immensely curious why the behavior would
>differ...
>
>-- 
>Scott
>

                C.J. Oster (Linux Guru/Surge Addict)
------------------------------------------------------------------
| [EMAIL PROTECTED]   |   910 S. 3rd St, #1218  |   CCSO, WSG, UIUC  |
| [EMAIL PROTECTED]  |   Champaing, IL 61820   |   1443 DCL, Urbana |
------------------------------------------------------------------
                   (580)761-6393 (217)328-8934
      "Linux, for people with an IQ above 98" - Bumper Sticker
 "Hm, a little big for a cup holder... Why does it say '4x' on it?"

Reply via email to