while [ -z $pass1 ] || [ -z $pass2 ] || [ $pass1 != $pass2 ]
do
read -p "Please type your passwd :" pass1
read -p "Please conform your passwd :" pass2
if [ -z $pass1 ]; then
echo "passwd should not be empty!"
elif [ $pass1 != $pass2 ]; then
echo "passwd not match! retype again!"
fi
done