[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[K12OSN] scripting trash removal



Dave was nice to send me this for clearing cache

!#/bin/bash
for x in `ls /home`; do
echo "Doing $x ..."
cd /home/${x}/.mozilla/firefox/*.default/Cache
rm -Rf *
done

Ok that works just fine. Soooo, If that works for cache, with a little mod like this

!#/bin/bash
for x in `ls /home`; do
echo "Doing $x ..."
cd /home/${x}/.Trash
rm -Rf *
done

It should clear out the .Trash directory only... right?
I Ran the script and it deleted out the trash, but it also deleted all non hidden files in the root directory from which I ran the script.. including itself. I'm sure it is obvious to someone who knows, but I don't see why it is killing all the files.
Any Help Appreciated
Mark

--
Mark Gumprecht
Data Systems Specialist
MSAD3
Unity, ME
gumprechtm msad3 org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]