if [ ! -f account.txt ]; then
echo "The file do not exist!"
exit 1
fi
username=$(cat account.txt)
for username in $username
do
useradd $username
echo $username | passwd --stdin $username
chage -d 0 $username
done
用户列表在account.txt文件里
原文:http://blog.51cto.com/652465/2094552