vim udel.sh
!/bin/bash
if [ $# -lt 1 ];then
echo "请输入参数del:"
exit 0
fi
if [ $1 == "del" ];then
for I in {1..10};do
if id user$I &> /dev/null;then
id user$I
userdel -r user$I
echo "delete user$I sucessful"
else
echo "no user$I"
fi
done
fi
vim udel.sh
if [ $# -lt 1 ];then
echo "请输入参数del:"
exit 0
fi
if [ $1 == "del" ];then
for I in {1..10};do
if id user$I &> /dev/null;then
id user$I
userdel -r user$I
echo "delete user$I sucessful"
else
echo "no user$I"
fi
done
fi