Re: jobs in jobs; jobs control
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Thu, 24 May 2007 00:09:13 -0400
In article <1179897190.132584.60250@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ben <chinese.central@xxxxxxxxxxxxxx> wrote:
When I did a for loop to start some background jobs
i.e
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 ***
.
- References:
- jobs in jobs; jobs control
- From: Ben
- jobs in jobs; jobs control
- Prev by Date: Re: Add columns
- Next by Date: Re: is there a cp argument that preserves directory structure
- Previous by thread: Re: jobs in jobs; jobs control
- Next by thread: is there a cp argument that preserves directory structure
- Index(es):
Relevant Pages
|