教程集 www.jiaochengji.com
教程集 >  脚本编程  >  shell  >  正文 一个批量添加用户的shell脚本

一个批量添加用户的shell脚本

发布时间:2014-09-11   编辑:jiaochengji.com
一个批量添加用户的shell脚本

一个批量添加用户的shell脚本,供大家学习参考。
 

复制代码 代码如下:
#!/bin/bash
#useradd andpassword
echo "please input username:"
read name
echo "please input number:"
read num
n=1
while [ $n -le $num ]
do
useradd $name$n
n=`expr $n + 1 `
done
#/etc/shasow info
echo "please input passwd"
read passwd
m=1
while [ $m -le $num ]
do
  echo $passwd |passwd --stdin $name$m >/dev/null
  m=`expr $m + 1 `
done

您可能感兴趣的文章:
一个批量添加用户的shell脚本
批量创建用户并设置密码的脚本
shell脚本向mysql表批量插入数据
expect批量管理计算机的一个脚本
Solaris批量创建用户与密码的技巧分享
Linux中生成随机密码的shell脚本
深入解析tcsh的初始化配置文件
批量创建连续的系统账号的shell脚本
linux批量修改文件名的shell脚本
shell变量$#,$@,$0,$1,$2详解

关键词: 批量添加   
[关闭]
~ ~