1. 程式人生 > >shell 指定用戶交互式登錄

shell 指定用戶交互式登錄

shell

#!/bin/bash
#2017-8-23
#這是一個交互式登錄指定用戶名以及密碼的腳本
uname=zhangsan
passwd=123
read -p "Please enter your name : " UNAME 
read -p "Please enter your passwd: " PASSWD
if [ "$UNAME" == "zhangsan" ] | [ "$PASSWD" == "123" ] ; then
 echo "your name is $uname passwd is $passwd"
else
 echo "fail"
fi


shell 指定用戶交互式登錄