Could somebody explain to me why the following doesnt work, or offer a better solution please?
-- DIRECTORY=".thumbnails"
remThumbs() { rm -rf $DIRECTORY }
for i in `ls -a` ; do if [ -d $i ] ; then echo "Yup, $i is a directory" if [ $i == $DIRECTORY && $i != "." || $i != ".." ] ; then echo "Removing $i ..." # remThumbs else echo "Entering $i ..." cd $i $HOME/bin/remThumbnails fi else echo "Nope, $i is a file" fi done
--
Thanks,
Andrew.