編寫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