script.sh

#!/bin/bashbash

 

    while [ "$#" -lt "2" ]ide

      dospa

      echo "please give me userfile or passwdfile"it

      exit 0class

    donefile

 

touch $1 $2touch

    x=`cat $1 | wc -l`di

    y=`cat $2 | wc -l`view

    if [ "$x" -ne "$y" ];thenvi

       echo "/mnt/userfile's line is different /mnt/passwdfile's line"

       exit 0

    else

       echo "             "

    fi

 

if id -u $1 >/dev/null;then

    echo "user exists"

    echo "           "

else

    useradd $1

    echo $2|passwd --stdin $1

fi

相關文章
相關標籤/搜索