Hey, here's another approach:
if [ "$LOG" = '' ] ; then LOG=gralog.`date +%Y%m%d%H%M%S` ; export LOG cat >/tmp/temp.sh.$$ <<EOF #!/bin/sh exec "$0" "${@}" EOF chmod +x /tmp/temp.sh SHELL=/tmp/sh.$$ ; export SHELL exec script /tmp/$LOG fi # do a bunch of stuff if [ "$LOG" != '' ] ; then rm -f $0 fi I included the temporary shell script because I think that "script" will rightly freak out if I included the arguments in the SHELL variable. Hope this helps, --kevin -- Kevin D. Clark (CetaceanNetworks.com!kclark) | Cetacean Networks, Inc. | Give me a decent UNIX Portsmouth, N.H. (USA) | and I can move the world alumni.unh.edu!kdc (PGP Key Available) | ***************************************************************** To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *****************************************************************