#!/bin/bash
# Auto add user program
#Author HaHaZhu 12/23/06
Loop=0
echo -n "Please Input total users:"
read Total
echo -n "Please Input user name:"
read user
echo -n "Please Input User password:"
read password
echo -e "Format:User:$user$Loop\tPassword:$password"
echo "waiting...."
sleep 2
tput clear
echo "Are you sure?[y|n]"
read ANS
case $ANS in
y|Y)
while [ $Loop -lt $Total ]
do
adduser $user$Loop
echo "$password"|passwd $user$Loop --stdin >/dev/null
if [ $? = 0 ];then
echo "$user$Loop ok!"
else
echo "$user$Loop fail!"
fi
Loop=`expr "$Loop" + 1`
done
;;
n|N)
;;
esac
====================================
在输入上没有过滤.......我想.....如果是管理人员使用的话,应该不成问题的.