echo -n "input the user name: "
read username
echo -n "remove the home directory?[yes/no] "
read confirm
if [ $confirm == "yes" ] ; then
userdel -r $username
elif [ $confirm == "no" ] ; then
userdel $username
else
echo "you should input yes or no!!"
fi;
转载于:https://blog.51cto.com/mattsong/481469