########################################################

# cancellazione ricorsiva

#
########################################################

#!/bin/bash
# this script find and delete a Directory Recoursively in a complex tree
# by andrea perdicchia
# vers. 0.1
# idea http://wooledge.org:8000/BashFAQ/030
if [ -z $@ ]; then
echo “insert a directory”;
else
read -p “sure? (yes|no) ”  key
if [ $key == ‘yes’ ]

then
find . -iname $1 -print0 | while read -r -d $” f;
do
echo “Delete $f”;
rm -rf $f;
done
else
echo “Nothing to do…”
fi
fi

Annunci