#!/bin/bash
USER_NAME=$@
for USER in $USER_NAME;do
if ! id $USER &>/dev/null; then
PASS=`echo $RANDOM |md5sum |cut -c 1-10`
useradd $USER
chage -d 0 $USER
echo $PASS |passwd --stdin $USER
echo "$USER $PASS" >>/tmp/user_info
echo "用户创建成功"
else
echo "用户已经存在"
fi
done