注册 登录
编程论坛 Linux教室

求助:shell编程中的if语句总得不到要求的结果

之梦 发布于 2010-06-15 12:38, 1059 次点击
[root@70 tmp]# cat test1.sh
#!/bin/bash
echo "============================"
read order
if [ "order" == y ]
then
  echo "yyyyyyyyyy"
  echo "fffffffff"
fi
[root@70 tmp]# ./test1.sh
============================
y
[root@70 tmp]# vi test1.sh
[root@70 tmp]# ./test1.sh
============================
n
这个是为什么呢?
2 回复
#2
之梦2010-06-15 12:50
.....傻了。。没加$
#3
Fjcyz2010-06-19 14:38
呵呵~
1