Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: checking jobs when zsh exits
- X-seq: zsh-users 2805
- From: "TjL" <tjlists@xxxxxxxxxxx>
- To: "Alan Iwi" <iwi@xxxxxxxxxxxx>, <zsh-users@xxxxxxxxxxxxxxx>
- Subject: RE: checking jobs when zsh exits
- Date: Fri, 24 Dec 1999 09:37:14 -0500
- Importance: Normal
- In-reply-to: <Pine.LNX.3.96.991224121551.28894C-100000@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxx 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author