文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>批量添加删除用户(SHELL)

批量添加删除用户(SHELL)

时间:2009-03-23  来源:sjhf

#######################################################################
   #!/bin/bash
   #the script act on a batch of add user,username at the same password
   #If you have any suggestions for corrections,please leave me a comment, and I’ll check it out.
   read -p "please input username and number(for example:xuanfei 100):" a b
   for((i=1;i<=$b+1;i++))
   do
   useradd -m $a$i
   echo "$a$i:$a$i" |chpasswd
   pwconv && echo "add succeed :$a$i"
   done
#######################################################################  
   #!/bin/bash
   #the script act on delete user for the same The same features (for example:xuanfei1 xuanfei2 xuanfei3)
   #If you have any suggestions for corrections,please leave me a comment, and I’ll check it out.
   read -p "please input the username location (for example:xuanfei 1 100):" a b c
   let d=$c-$b+1
   for((i=1;i<=$d;i++))
   do
   userdel $a$b && echo "delete succeed:$a$b"
   rm -rf /home/$a$b
   let b=b+1
   done
#######################################################################
相关阅读 更多 +
排行榜 更多 +
拉什拉力赛3内置菜单

拉什拉力赛3内置菜单

赛车竞速 下载
疯狂车吃车3内置菜单

疯狂车吃车3内置菜单

赛车竞速 下载
代号速降手游

代号速降手游

赛车竞速 下载