From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2674 invoked from network); 12 Jan 2005 14:57:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Jan 2005 14:57:56 -0000 Received: (qmail 27256 invoked from network); 12 Jan 2005 14:57:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Jan 2005 14:57:50 -0000 Received: (qmail 23595 invoked by alias); 12 Jan 2005 14:56:59 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8357 Received: (qmail 23578 invoked from network); 12 Jan 2005 14:56:58 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Jan 2005 14:56:58 -0000 Received: (qmail 25670 invoked from network); 12 Jan 2005 14:56:22 -0000 Received: from redfish.gatech.edu (HELO cyberbuzz.gatech.edu) (130.207.165.230) by a.mx.sunsite.dk with SMTP; 12 Jan 2005 14:56:19 -0000 Received: by cyberbuzz.gatech.edu (Postfix, from userid 20135) id 0C3DE42B2E; Wed, 12 Jan 2005 09:56:15 -0500 (EST) Date: Wed, 12 Jan 2005 09:56:14 -0500 From: Jason Price To: zsh-users@sunsite.dk Subject: Scripting subprocesses and timed waits. Message-ID: <20050112095614.A16221@redfish.gatech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 I have a possibly long running expect script that goes off and does stuff. Sometimes it takes a long time, and sometimes it will never return at all. I'd like to find a way to fire off several of these, and notice when each finishes. If they don't finish after x seconds, just kill those attempts and move on. Ideally I'd like to fire off each of these scripts into the background, if they all finish quickly, move on. If one or more take more than the full time I give them, kill them. Is there a clever zsh way to do this? I've noticed coprocesses in the past and in the manual, but I haven't figured out how to control it sufficiently for this usage. Thanks; Jason