From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3160 invoked from network); 24 Dec 1999 14:38:09 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Dec 1999 14:38:09 -0000 Received: (qmail 15516 invoked by alias); 24 Dec 1999 14:37:54 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2805 Received: (qmail 15508 invoked from network); 24 Dec 1999 14:37:53 -0000 From: "TjL" To: "Alan Iwi" , Subject: RE: checking jobs when zsh exits Date: Fri, 24 Dec 1999 09:37:14 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Alan Good suggestion.... I have a hackish way of doing this (below) but it would be nice if there was a better way. Also, fyi, the zsh-user@math.gatech.edu address is obsolete... unfortunately I don't have the new one, but I think you can find it at www.zsh.org Here's my hack-script, which I call "jobout" and then have: alias x='source jobout' and so when I want to logout I just type 'x' and it tells me if I have any jobs or not. TjL # RHOST is a variable I have setup based on # who am i |awk '{print $NF}'|tr -d '(|)' jobsfile=/tmp/jobs.$tty.$USER /bin/rm -f $jobsfile jobs -l 1>& $jobsfile COUNT=`wc -l $jobsfile | awk '{print $1}'` if [ "$COUNT" != "0" ] then echo "This tty has stopped jobs:" cat $jobsfile /bin/rm -f $jobsfile else KEEPALIVEPID=`awk '{print $3}' $jobsfile` echo "killing $KEEPALIVEPID" kill -9 $KEEPALIVEPID echo "No jobs running" /bin/rm -f $jobsfile echo "Logout complete from $HOST, returning to $RHOST" exit 0 fi