public inbox for gentoo-user-de@lists.gentoo.org
 help / color / mirror / Atom feed
From: Emil Beinroth <emilbeinroth@gmx.net>
To: gentoo-user-de@lists.gentoo.org
Subject: Re: [gentoo-user-de] Bash-Skript Frage
Date: Tue, 16 Aug 2005 17:12:16 +0200	[thread overview]
Message-ID: <20050816151216.GA32458@stovokor.kiste.lan> (raw)
In-Reply-To: <200508161616.21686.volker.katz@gmx.de>

On Tue, Aug 16, 2005 at 04:16:21PM +0200, Volker Katz wrote:
> Moin,
> ich habe mal wieder eine kleine Frage zu einem Bash-Skript.
> 
> Ich möchte mehrere Programme prallel laufen lassen - soweit ja kein Problem. 
> Einfach ein "&" hinter jedes Kommando und gut ist. Nur möchte ich ein 
> Kommando erst aufrufen, nachdem alle anderen fertig sind. 
> 
> Also in der Art:
> 
> /bin/job1 &
> /bin/job2 &
> /bin/job3 &
> while (not job1 finished && not job2 finished && not job3 finished)
> /bin/job4
> 
> (Natürlich ist mir klar, das aktives Warten nicht schön ist - ich wollte nur 
> mein Problem darstellen.)
> 
> Wie kann man das elegant machen? Die PIDs merken und in einer Schleife 
> kontrollieren? Wie würde soetwas aussehen?
> 
> Gruß & Danke
>   Volker

Hi,
wie waers mit sowas?

pids=""
/bin/job1 &
pids="${pids} ${!}"
/bin/job2 &
pids="${pids} ${!}"
/bin/job3 &
pids="${pids} ${!}"
wait $pids
/bin/job4

Cheers, Emil

-- 
gentoo-user-de@gentoo.org mailing list



  reply	other threads:[~2005-08-16 15:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-16 14:16 [gentoo-user-de] Bash-Skript Frage Volker Katz
2005-08-16 15:12 ` Emil Beinroth [this message]
2005-08-16 17:14 ` Nils Andresen
2005-08-20  5:01   ` Karsten Schulz
2005-08-20 10:04   ` [gentoo-user-de] " Thomas Schweikle
2005-08-20 10:39     ` Hendrik Jürgens
2005-08-20 13:16       ` Thomas Schweikle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050816151216.GA32458@stovokor.kiste.lan \
    --to=emilbeinroth@gmx.net \
    --cc=gentoo-user-de@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox