[K12OSN] shell script to remove contents of several files
cliebow at midmaine.com
cliebow at midmaine.com
Sat May 20 10:42:27 UTC 2006
fwiw.
#!/bin/bash
ls -l /var/mail>/tmp/users
exit
#see if you get all users like that then remove the exit
cat /tmp/users|while read usedude;do
echo $userdude
ls /var/mail/$userdude/$userdude.*
sleep 5
done
exit
#check this to see which file needs removing then replace the * with the
sufix.run again to be sure it picks out the right file thenremove the exit
# when you are sure it picks the right file put this in theloop
#rm /var/mail/$userdude/$userdude.correctsuffix
#this is not pretty or elegant or efficient but gives you a lt of control
what happens
More information about the K12OSN
mailing list