From owner-freebsd-questions@FreeBSD.ORG Wed Nov 8 10:29:16 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EC7916A4D2 for ; Wed, 8 Nov 2006 10:29:16 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9613043D66 for ; Wed, 8 Nov 2006 10:27:13 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so1270465uge for ; Wed, 08 Nov 2006 02:27:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=FRCRUUm94wZ6JZSd/YWIoYD9WN6vN1bYr2zcbbOJ4Nr2bzpLWLYxxzSfxrTGYUOmBiD7HgZpzTPD6TfTs2tIwtTZST/a84Dmu8VaMMQC+P/GzvgQFgAWoTPNTX66hM7KiTuAMGkFgampZvfYtv6AbQw5jwOymgqPW4i/bnjmTLQ= Received: by 10.78.57.11 with SMTP id f11mr6225122hua.1162981260485; Wed, 08 Nov 2006 02:21:00 -0800 (PST) Received: by 10.78.167.16 with HTTP; Wed, 8 Nov 2006 02:21:00 -0800 (PST) Message-ID: Date: Wed, 8 Nov 2006 13:21:00 +0300 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: nicky In-Reply-To: <4551AC4A.2000108@valuecare.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4551AC4A.2000108@valuecare.nl> X-Google-Sender-Auth: 3c01a69bd5db5631 Cc: freebsd-questions@freebsd.org Subject: Re: Parallel shell scripts. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2006 10:29:16 -0000 On 11/8/06, nicky wrote: > I have to start 2 processes in the background (running in parallel), > capture their return codes and after all 4 have completed successfully i > want to continue with the main script. What do you need their return codes for? If you only want to display them, something like this might help: (/bin/proc1;echo "Proc 1 exited with status $?) & (/bin/proc2;echo "Proc 2 exited with status $?) & wait In general, retrieving exit statuses of multiple general is not trivial. I.e. you need some kind of IPC for that, at least store statuses in some tmp files and read it back from the main process.