改写rm

#!/bin/bashfileName=$1now=`date +%Y%m%d%H%M`read -p "Are you sure delete the file or directory $1? yes|no: " input if [ $input == "yes" ] || [ $input == "y" ]then    mkdir -p /data/$now    rsync -aR $1/ /data/$now/$1/    /bin/rm -rf $1elif [ $input == "no" ] || [ $input == "n" ]then    exit 0else    echo "Only input yes or no"    exitfi
(0)

相关推荐