Poub=~/.poubelle if [ ! -d $Poub ] then mkdir $Poub fi find $Poub -mtime +30 -exec rm {} \; 2>/dev/null if [ $# -eq 0 ] then exit 0 fi if [ `pwd` != $Poub ] then for i in $* do if [ -f $i -o -d $i ] then if [ `ls -a $Poub | grep -c $i` -eq 0 ] then touch $i mv $i $Poub else echo "$i existe deja dans la poubelle" echo "Voulez-vous continuer [y|n]?" read reponse if [ $reponse = "y" -o $reponse = "Y" ] then rm -r $Poub/$i touch $i mv $i $Poub fi fi else echo "$i n'existe pas" fi done fi