#!/bin/csh -f
set host=`hostname`
set refpr=$$
if( -d /usr/bsd || -d /usr/bsd43 ) then
ps -e > /tmp/$refpr
else
ps -ax > /tmp/$refpr
endif
foreach i (`/bin/ls ~/tmp/$host`)
#echo looking for process $i
 if ("`cat /tmp/$refpr | cut -c1-9 | grep $i`" == "") then
  rm -fr ~/tmp/$host/$i
  echo removing ~/tmp/$host/$i
 endif
end
rm /tmp/$refpr
unset host
unset refpr
