模拟用户登录的操作

 1 # /bin/bash
 2 
 3 echo -n login:
 4 read name
 5 echo -n password:
 6 read passwd
 7 
 8 if [ $name = "chat" -a $passwd = "abc" ]; then
 9   echo "the host and passwdrd is right!"
10 else
11   echo "input is error!"
12 fi
13 
14 #end

注意:if语句的格式: if [space judge_condition space]; then

posted on 2013-12-14 13:51  笔记吧... 可能只有自己看得懂  阅读(196)  评论(0编辑  收藏  举报