根据/etc下的四个文件创建用户名:
 #!/bin/bash
#AUtor : gaohuina
#date: 2010-12-31
#DESC :

MYUID= $[`cut -d: -f3 /etc/passwd | sort -n | grep -v "65534" | tail -1`+1]

MYGID= $[`cut -d: -f3 /etc/group | sort -n | grep -v "65534" | tail -1`+1]
MYDAY=$[`date +"%s"` /60/60/24]
  if ! cut -d: -f1 /etc/passwd | grep "^$1" &> /dev/null; then

    echo "$1::$MYUID:$MYGID::/home/$1:/bin/bash" >> /etc/passwd
    echo "$1:!!:$MYDAY:0:99999:7:::" >> /etc/shadow
  else
     echo "the $1 is exit"
     exit 1
  fi
if ! cut -d: -f1 /etc/group | grep "^$1" &> /dev/null; then
  echo "$1:x:$MYGID:" &> /etc/grouop
else
echo "the group is exit"
exit 1
fi