Shell脚本练习4
vi /shell/user.txt 用户1 用户2 用户3 #!/bin/bash max_u=4 for i in $(more /shell/user.txt | awk '{print $1}') #绝对路径 do useradd $i echo "asda122" | passwd --stdin $i echo "user $i have been create" done
批量创建用户
passwd为交互式命令 --stdin 直接导入密码
玩儿
vi /shell/user.txt 用户1 用户2 用户3 #!/bin/bash max_u=4 for i in $(more /shell/user.txt | awk '{print $1}') #绝对路径 do useradd $i echo "asda122" | passwd --stdin $i echo "user $i have been create" done
批量创建用户
passwd为交互式命令 --stdin 直接导入密码