judge_user_passwd.sh 登录后复制 #!/bin/bash read -p "Please input username:" user read -p "Please input password:" pass if [ "$user" == 'ztj' -a "$pass" == '123456' ];then echo "Login Successful" else echo "Login Failed" fi 1.2.3.4.5.6.7.8.9. 验证: 登录后复制 [root@logstash ~]# sh judge_user_passwd.sh Please input username:a Please input password:b Login Failed [root@logstash ~]# sh judge_user_passwd.sh Please input username:ztj Please input password:123456 Login Successful [root@logstash ~]# 1.2.3.4.5.6.7.8.9. 原创作者: ztj1216 转载于: https://blog.51cto.com/ztj1216/11467315