编写shell程序,实现自动删除50个用户账号的功能。账号名为stud1至stud50。
#!/bin/bash
for i in {1..50}
do
id stud$i
if [ $? -eq 0 ];then
userdel stud$i
fi
done
echo "已删除"stud$i
编写shell程序,实现自动删除50个用户账号的功能。账号名为stud1至stud50。
#!/bin/bash
for i in {1..50}
do
id stud$i
if [ $? -eq 0 ];then
userdel stud$i
fi
done
echo "已删除"stud$i