#!/bin/ksh
echo attempting to clean up temporary directories
if [[ "$TMPBASE" != "" ]]
then
  if [[ "$ZZZPID" != "" ]]
  then
    test -d $TMPBASE/$ZZZPID && rm -rf $TMPBASE/$ZZZPID && echo removing  TMPDIR=$TMPBASE/$ZZZPID
    test -d /tmp/$LOGNAME/$ZZZPID && rm -rf /tmp/$LOGNAME/$ZZZPID && echo removing TMPDIR=/tmp/$LOGNAME/$ZZZPID
    test -d /scratch/$LOGNAME/$ZZZPID && rm -rf /scratch/$LOGNAME/$ZZZPID && echo removing TMPDIR=/scratch/$LOGNAME/$ZZZPID
    test -d $HOME/big_tmp/$HOSTNAME/$ZZZPID && rm -rf $HOME/big_tmp/$HOSTNAME/$ZZZPID && echo removing TMPDIR=$HOME/big_tmp/$HOSTNAME/$ZZZPID
    test -d $HOME/big_tmp/$TRUE_HOST/$ZZZPID && rm -rf $HOME/big_tmp/$TRUE_HOST/$ZZZPID && echo removing TMPDIR=$HOME/big_tmp/$TRUE_HOST/$ZZZPID
  else
    echo "ZZZPID not defined, TMPDIR(s) will not be removed"
  fi
else
  echo "TMPBASE not defined, TMPDIR(s) will not be removed"
fi
if [[ "$HISTFILE" = "$HISTFILE_" ]]
then
  /bin/rm -f $HISTFILE_
fi
