Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!caip!nike!oliveb!tolerant!waynet From: waynet@tolerant.UUCP (Wayne Thompson) Newsgroups: net.sources Subject: Re: after csh script Message-ID: <387@tolerant.UUCP> Date: Wed, 23-Jul-86 23:56:48 EDT Article-I.D.: tolerant.387 Posted: Wed Jul 23 23:56:48 1986 Date-Received: Thu, 24-Jul-86 08:14:39 EDT Distribution: net Organization: Tolerant Systems, Inc. San Jose, CA Lines: 36 Here's a hacked version. #! /bin/csh -f # # "after". 21jul86. runs a shell script after a running process has finished # Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027 # {philabs,rna}!cubsvax!peters cubsvax!peters@columbia.ARPA # parse command line, and set sleep interval if not specified if ($#argv == 3) then set seconds = $argv[3] else if ($#argv == 2) then set seconds = 900 else echo 'usage: after pid shellscript [seconds, default=900 ]' exit endif # take a breather for $seconds; check for pid; # when no longer found, run script ($agrv[2]), cleanup and exit while (1) sleep $seconds if (`nice ps | awk '/^'"$argv[1]"'/ { print "1" }'` != 1) then $argv[2] exit endif end -- Which is worse ignorance or apathy? Who knows, who cares. Wayne Thompson ..{bene,mordor,nsc,oliveb,pyramid,ucbvax}!tolerant!waynet Your mission, should you decide to accept it, is to discern who is responsible for these opinions, the poster or the company he works for. Good luck!!