Re: jobs in jobs; jobs control

In article <1179897190.132584.60250@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ben <chinese.central@xxxxxxxxxxxxxx> wrote:

When I did a for loop to start some background jobs
for ... do
command &
done &

when I type jobs, I can only see the for loop jobs, after the for loop
finishes, I can't see any jobs with the command jobs... I know the
"hidden" jobs are running since they are producing data... how can I
job control them?

A process can only control its child processes, not further descendant
processes. By putting the loop in the background you require a child
for the loop, and as a result all the commands run in grandchild
processes, which your original shell can't control.

If your system has the "pstree" command this is a way to see this
process hierarchy.

Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***