Bug 483

Summary: Allow jobs builtin to pipe output to current shell
Product: Busybox Reporter: Earl Chew <echew>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: busybox-cvs
Priority: P3    
Version: 1.14.x   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Host: Target:
Build:
Attachments: Allow output of jobs to be piped

Description Earl Chew 2009-07-23 05:41:16 UTC
This change allows $(jobs -p) to work.

Some references:

http://kb.iu.edu/data/aegh.html
http://lists.freebsd.org/pipermail/freebsd-bugs/2009-April/034763.html

With this change, the following:


ls | date | sleep 30 &
jobs
jobs -p
jobs -l
jobs -pl

echo Test 1 ; jobs -p | cat
echo Test 2 ; date | jobs -p | cat
echo Test 3 ; X=$(jobs -p) ; echo "$X"
echo Test 4
for X in `jobs -p` ; do
  echo "$X"
done


produces the output:

[1] + Running                    ls | date | sleep 30
8257
[1] + 8257 Running               ls
      8258                       | date
      8259                       | sleep 30
[1] + 8257 Running               ls
      8258                       | date
      8259                       | sleep 30
Test 1
8257
Test 2
8257
Test 3
8257
Test 4
8257
Comment 1 Earl Chew 2009-07-23 05:41:48 UTC
Created attachment 493 [details]
Allow output of jobs to be piped
Comment 2 Denys Vlasenko 2009-07-23 22:17:45 UTC
Applied, thanks!
Comment 3 Denys Vlasenko 2009-07-25 09:16:23 UTC
Closing as fixed. If you can, please try current git and reopen if there are problems.