批量创建用户
作者:互联网
$ cat test26
#!/bin/bash
# process new user accounts
input="users.csv"
while IFS=',' read -r userid name
do
echo "adding $userid"
useradd -c "$name" -m $userid #添加备注,并创建指定家目录
done < "$input"
$
cat users.csv
rich,Richard Blum
christine,Christine Bresnahan
barbara,Barbara Blum
tim,Timothy Bresnahan
标签:Timothy,users,批量,创建,userid,用户,cat,Richard 来源: https://www.cnblogs.com/ym-xfl/p/14401781.html