新手问个linux循环脚本问题
请问在linux下分别用for ,while,until 语句创建100用户,并显示这100用户的的脚本怎么写?
作者: 非柳非 发布时间: 2011-10-15
vi addusers.sh
#!/bin/bash
while read user_name password
do
useradd ${user_name} >/dev/null 2>&1
echo ${password}|passwd --stdin ${user_name} >/dev/null 2>&1
echo ${user_name}
done <users.txt
cat users.txt
kevin pas123
mark mark
#!/bin/bash
while read user_name password
do
useradd ${user_name} >/dev/null 2>&1
echo ${password}|passwd --stdin ${user_name} >/dev/null 2>&1
echo ${user_name}
done <users.txt
cat users.txt
kevin pas123
mark mark
作者: 767956048 发布时间: 2011-12-03