且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Bash脚本从文本文件创建/删除用户

更新时间:2023-12-05 20:31:22

读完文件名后,您必须遍历该文件并为文件的每一行创建或删除用户.

After you read in the name of the file you have to iterate through that file and create or delete user for each line of the file.

示例:

for user in `cat user_list`
do
    sudo useradd "$user" -m -p "$user"
done