PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > jobs in jobs; jobs control
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

jobs in jobs; jobs control

Réponse
 
LinkBack Outils de la discussion
Vieux 23/05/2007, 06h13   #1
Ben
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut jobs in jobs; jobs control

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?

Regards

  Réponse avec citation
Vieux 23/05/2007, 21h22   #2
Michael Tosch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: jobs in jobs; jobs control

Ben 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?
>
> Regards
>


run the loop in the foreground:

for ...
do
command &
done
jobs

--
Michael Tosch @ hp : com
  Réponse avec citation
Vieux 24/05/2007, 05h09   #3
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: jobs in jobs; jobs control

In article <1179897190.132584.60250@u30g2000hsc.googlegroups. com>,
Ben <chinese.central@googlemail.com> 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@alum.mit.edu
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 ***
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h49.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09000 seconds with 11 queries