From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23004 invoked by alias); 12 Dec 2011 17:08:47 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16621 Received: (qmail 13224 invoked from network); 12 Dec 2011 17:08:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <20111212154601.GA5198@cosy.cit.nih.gov> References: <20111212154601.GA5198@cosy.cit.nih.gov> From: TJ Luoma Date: Mon, 12 Dec 2011 11:37:11 -0500 Message-ID: Subject: Re: wait for the next process to finish To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=e89a8ff1c094724f1604b3e7c139 --e89a8ff1c094724f1604b3e7c139 Content-Type: text/plain; charset=UTF-8 On Mon, Dec 12, 2011 at 10:46 AM, Anthony R Fletcher 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 > --e89a8ff1c094724f1604b3e7c139--