我刚开始接触linux,在学vim的条件判断时作练习
echo "Press y to continue."
read yn
if ["$yn"="y"]; then
echo "script is running..."
else
echo "stop!"
fi
运行的时候出现错误
test06-ifthen.sh: line 7: [y:找不到命令
上面的命令是按课本照搬的。
另外确定已经安装vim-full
求解~~!!!
初学菜鸟的vim问题
-
- 帖子: 7
- 注册时间: 2009-11-01 23:51
- leeaman
- 帖子: 30702
- 注册时间: 2007-02-02 18:14
- 系统: debian sid
-
- 帖子: 7
- 注册时间: 2009-11-01 23:51
Re: 初学菜鸟的vim问题
我就是在终端中运行的 用 sh 命令
sh test06-ifthen.sh
sh test06-ifthen.sh
- leeaman
- 帖子: 30702
- 注册时间: 2007-02-02 18:14
- 系统: debian sid
-
- 帖子: 7
- 注册时间: 2009-11-01 23:51
Re: 初学菜鸟的vim问题
还是同样的问题
运行之后终端中显示
Press y to continue.
y
./test06-ifthen.sh: line 7: [y:找不到命令
stop!
运行之后终端中显示
Press y to continue.
y
./test06-ifthen.sh: line 7: [y:找不到命令
stop!
-
- 帖子: 1
- 注册时间: 2009-11-01 12:33
Re: 初学菜鸟的vim问题
'['后面加空格 ‘]'前面也加空格
-
- 帖子: 7
- 注册时间: 2009-11-01 23:51
Re: 初学菜鸟的vim问题
谢谢~~~你说的对 问题解决了k1z 写了:'['后面加空格 ‘]'前面也加空格
也谢谢leeaman热心帮助~~~~