#!/bin/csh -f

del /u/rig ujunk.tmp
cd /u
echo > /tmp/junktotals
foreach user (*)
  junk -c 'ls -l' $user | total '$4/$2' "bytes $user" | grep "Total"\
    >> /tmp/junktotals
end
cat /tmp/junktotals | total -p '$1' | grep "Total" | sort -nr >/u/rig/ujunk.tmp
rm /tmp/junktotals
cd /u/rig
chown rig ujunk.tmp
chgrp toc ujunk.tmp
