Bug 483 - Allow jobs builtin to pipe output to current shell
Summary: Allow jobs builtin to pipe output to current shell
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.14.x
Hardware: PC Windows
: P3 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-23 05:41 UTC by Earl Chew
Modified: 2009-07-25 09:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Allow output of jobs to be piped (1.29 KB, patch)
2009-07-23 05:41 UTC, Earl Chew
Details

Note You need to log in before you can comment on or make changes to this bug.
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.