您的位置:首页 > 运维架构 > Shell

shell添加用户脚本

2011-12-09 09:31 197 查看
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

本文出自 “游造技术博客” 博客,请务必保留此出处http://youzao.blog.51cto.com/3946111/737752
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: