shell_user_login01

#!/bin/bash
username='Jack'
password='abc.123'

read -p "Please input your username:" user
read -p "Please input your password:" pass

if [ ${username} == ${user} ] && [ ${password} == ${pass} ];then
   echo "${username} login success"
elif [ ${username} == ${user} ] && [ ${password} != ${pass} ];then
   echo "Invalid password"
   count=0
   while [[ ${count}<2 ]]
   do
       read -p "Please input your password:" pass
       if [ ${password} == ${pass} ];then
             echo "${username} login success"
       else
             count=$((${count}+1))
       fi
    done
else
   echo "Invalid User ${username}"
fi
请使用浏览器的分享功能分享到微信等