From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8375 invoked by alias); 10 Apr 2010 03:32:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27872 Received: (qmail 5950 invoked from network); 10 Apr 2010 03:32:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100409203143.ZM16397@torch.brasslantern.com> Date: Fri, 09 Apr 2010 20:31:41 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "wait gets confused when second argument exits before first (i think)" (Apr 10, 3:37am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: wait gets confused when second argument exits before first (i think) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Apr 10, 3:37am, Mikael Magnusson wrote: } } So it looks like it doesn't matter if %1 or %2 exits first, just which } is the first argument to wait. The wait isn't performed in parallel for all the argument PIDs at once (it's not like doing a select() on a list of file descriptors). Rather the shell waits for each PID in the order it appears on the command line, before attempting to wait on the next one. See zsh-workers/27442 and its thread for possibly-related discussion; there doesn't appear to be a requirement that the shell keep track of more than one already-exited asynchronous job. --