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
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 ***
.



Relevant Pages

  • Sol8 and EVA hangs
    ... Secure Path 3.0D is loaded for channel failover. ... retrying command ... # Adapter hard loop ID address to use on the fibre channel bus. ...
    (SunManagers)
  • Summary: Sol8 and EVA hangs
    ... Oct 8 11:00:41 proddb SCSI transport failed: reason 'aborted': ... retrying command ... # Adapter hard loop ID address to use on the fibre channel bus. ... # before reporting I/O errors. ...
    (SunManagers)
  • Re: Using foreach loop to create radiobutton menu
    ... Your foreach loop is not the problem, the problem is how you define the -command. ... The only possible thing the interpreter can do is substitute the current value of range, which is likely the last value once your loop exited. ... One choice is double quotes. ... The double quotes means that $range gets expanded while in the loop, long before the puts command actually runs. ...
    (comp.lang.tcl)
  • Re: Issue implementing Runtime.exec() with StreamGobbler
    ... So jloader basically calls LoaderAutomationRun.java (starts the loop) ... As you can see the last line, the New Command Executer never returned. ... If your test driver is hanging, I'd guess that the test process itself is ...
    (comp.lang.java.programmer)
  • Re: Ruby eval
    ... Is there a reason those aren't either constants or local variables? ... You get the idea -- put things in arrays or hashes, not global variables. ... other jobs later on. ... You don't have to change the loop or anything like that -- the number of jobs ...
    (comp.lang.ruby)