From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 630 invoked by alias); 12 Dec 2011 15:56:27 -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: 16620 Received: (qmail 23609 invoked from network); 12 Dec 2011 15:56:25 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at mail.nih.gov designates 128.231.90.98 as permitted sender) X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: E=Sophos;i="4.71,339,1320642000"; d="scan'208";a="60163010" X-Authentication-Warning: cosy.cit.nih.gov: arif set sender to Anthony R Fletcher using -f Date: Mon, 12 Dec 2011 10:46:01 -0500 From: Anthony R Fletcher To: Subject: wait for the next process to finish Message-ID: <20111212154601.GA5198@cosy.cit.nih.gov> Mail-Followup-To: zsh-users@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (cake.cit.nih.gov [165.112.93.31]); Mon, 12 Dec 2011 10:46:01 -0500 (EST) 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? Anthony.