Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10726141
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:09:31

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