When there are 10 or more ttys, $IWAS will show more than one name. The egrep line needs to be more specific....
[ "$IWAS" = "" ] && IWAS=`who | egrep $TTY | awk '{print $1}'`
Log in to post a comment.