vi /home/shell/useradd.sh
#!/bin/bash
i=1
while [ $i -le 5 ]
do
useradd test$i
let i++
done
执行:sh useradd.sh
cat /etc/passwd|grep test
test1:x:502:502::/home/test1:/bin/bash
test2:x:503:503::/home/test2:/bin/bash
test3:x:504:504::/home/test3:/bin/bash
test4:x:505:505::/home/test4:/bin/bash
test5:x:506:506::/home/test5:/bin/bash