Chinaunix首页 | 论坛 | 博客
  • 博客访问: 391386
  • 博文数量: 146
  • 博客积分: 7142
  • 博客等级: 少将
  • 技术积分: 975
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-03 09:43
文章分类

全部博文(146)

文章存档

2012年(1)

2011年(5)

2010年(24)

2009年(116)

我的朋友

分类:

2009-12-22 19:42:14

#######################################################################
   #!/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
#######################################################################
阅读(656) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~