Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: wait for the next process to finish
- X-seq: zsh-users 16621
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: wait for the next process to finish
- Date: Mon, 12 Dec 2011 11:37:11 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ONBSBk+PADC9YRaHy9w7Ag0GGCEML3rxIBeIL/1Qyro=; b=PdByjKtW/YkVvRLn8E2bIjZ0e8KQMAWcHEM+KI8YkkzhzX/9tDfsoLg/iG2dL64HCS xvk+FOKH3mUC2HfcglmyIwN730Qc3UT+pagJNwFaIutSW/YRXX+RiWOYw6d8kNaBOBLT LEFzI8BgSSQwuDrfrY1agpOzoeBkTyLclLtUg=
- In-reply-to: <20111212154601.GA5198@cosy.cit.nih.gov>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20111212154601.GA5198@cosy.cit.nih.gov>
On Mon, Dec 12, 2011 at 10:46 AM, Anthony R Fletcher <arif@xxxxxxxxxxxx>wrote:
> I just realised that the 'wait' command will either wait for specified
> jobs or all jobs and nothing in between. The manual says "If job is not
> given then all currently active child processes are waited for.".
>
> So
> sleep 30 &
> sleep 10 &
> sleep 30 &
> sleep 30 &
> wait
> waits for all the sleeps to finish.
>
> How can I wait for just the next job to finish?
>
Just don't run it in the background.
or do it like this:
(job1 ; job2)
or, if you want to make sure that job2 only runs if job1 succeeds:
(job1 && job2)
TjL
ps - my apologies if I am misunderstanding the question
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author