From owner-freebsd-questions@FreeBSD.ORG Thu Nov 1 16:58:10 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C712616A46C for ; Thu, 1 Nov 2007 16:58:10 +0000 (UTC) (envelope-from aharrison@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEAA13C4BC for ; Thu, 1 Nov 2007 16:58:10 +0000 (UTC) (envelope-from aharrison@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so1074444pyb for ; Thu, 01 Nov 2007 09:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=q5mJUXTgtSwPhdK7AfXc79jOoiDCTWmVtZ3lXWZmi10=; b=hVSH7kf8XvdSgEX+hqq92oG76v3DfS5p70UnEdd/I0sfRcKniPiMoHt7jQbdoqA7wNvo8JLYgRhI8FaKBYsQ+igNsp8RNT3LX+J4+TqQwMzdrIyI9iTZGEXPjVtBQPlS3QNfy3H0dgbddMTvb2dXgfYD/QKCul3SDiqT7xXUhZE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Xsoht+uFCUjI3rJx7FJ79yxzSCie9e5EXIpmP3piCPltj4tq+Pzmwc9VQd7plEIcXCaOpo26DMjKIGHcPh//+SEJPYh3VJ+TOJvAp5HostCe2RMedlu45rQd7ZcJbGH6oMVdXUKUKIGwxdjU4yZOs1q2bmZ9mnHYBCkSBEngqLs= Received: by 10.65.196.2 with SMTP id y2mr4268408qbp.1193935900146; Thu, 01 Nov 2007 09:51:40 -0700 (PDT) Received: by 10.65.182.4 with HTTP; Thu, 1 Nov 2007 09:51:40 -0700 (PDT) Message-ID: Date: Thu, 1 Nov 2007 12:51:40 -0400 From: "Andy Harrison" To: freebsd-questions@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: Re: sh script difficulties (running parallel functions) 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: Thu, 01 Nov 2007 16:58:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/1/07, David Naylor wrote: > # !!! Somehow wait for over workers to finish before continuing !!! > } > > #Finished > > Furthermore, how can signals be handled such that the signals get > accumulated and once all the other workers have finished the signals get > passed on (appropriately) One simplistic way of doing something like that is to make each worker process write a file out to disk upon completion. Then have a while loop that sleeps for a minute and then checks for the existence of that file and if it finds it, execute other commands. Probably not the cleanest method, but I think you'll find that handling forks and signals in a shell script is more trouble than it's worth. - -- Andy Harrison public key: 0x67518262 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: http://firegpg.tuxfamily.org iD8DBQFHKgQ1NTm8fWdRgmIRAn7eAKCZthrDzv0j7J6urphY3ohm6bSPZgCeIAt6 vhC2Zxw0ZTxw8eT+NZ/Uktg= =schR -----END PGP SIGNATURE-----