Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/rc/cleantmp
#!/bin/rc rfork e cd /tmp tmp =`{ls} used=`{grep /tmp /proc/*/fd | awk '{print $11}' |uniq} for(i in $used) tmp=`{ echo $tmp | sed 's/'^`{basename $i}^'//'} rm -f $tmp