C.J. Oster on Wed, Dec 09, 1998 at 08:02:21PM -0500:
> Uh, unless you jave a differend 'jobs' than I do...
I don't think so. I don't understand why it works for others but not
me, although it does work for my under AIX. It must be something
specific to my setup. I have tested this using only the path kernel ->
init -> mingetty -> login -> bash, so it must be one of these programs
or something they link to that differs on my box.
> If for whatever reason your jobs prints to stderr, then you would say..
>
> jobs 2>&1 |grep pattern
Yep, I tried that, with no luck. I was thinking maybe it was using some
arbitrary file descriptor, but since I can "jobs >thisfile" and that
only captures stdout (and thisfile does indeed contain the jobs output),
then I know that's not it.
What I really don't get is why > and | seem to act differently since
they both read stdout...
> Just for the record, do you have any stopped or background jobs?
Of course I did actually have jobs when I tested jobs output :) Again,
redirect stdout to a file works, but not to a pipe. Highly strange.
With a --noprofile --norc shell:
bash-2.02# jobs
[1]+ Stopped man less
bash-2.02# jobs | cat
bash-2.02# jobs >thisfile; cat thisfile
[1]+ Stopped man less
bash-2.02#
I just don't get it since apparently this works for everyone else.
--
Scott