syntax error near unexpected token `then'问题的解决
来源:互联网 发布:vivo研发待遇知乎 编辑:程序博客网 时间:2024/05/19 20:43
#!/bin/bash#if program testecho 'a:'read aif [ "$a" = "English" ];thenecho "right"elseecho "wrong"fi
我是按照视频上的程序稍作修改写的shell脚本程序,结果执行时出现“syntax error near unexpected token `then’”,看半天没看出原因,上网查了半天,终于搞明白了原因:while 与‘[‘之间没有加空格导致的。另外,在执行时,我也发现 ‘=’两边必须也得加空格,否则也会出错,不是语法出错,而是不管赋给a的值是多少,程序都会得到if 后面的语句为假,从而得出wrong的情况。
下面是自己阅读了一些shell脚本之后的一个小程序:
实现了254 次打印了hello
阅读全文
0 0
- syntax error near unexpected token `then'问题的解决
- syntax error near unexpected token `then'问题的解决
- syntax error near unexpected token `then'问题的解决
- syntax error near unexpected token `then'问题的解决
- syntax error near unexpected token `then'问题的解决
- syntax error near unexpected token `then'问题的解决
- shell script中的syntax error near unexpected token `then' 问题
- syntax error near unexpected token `问题的解决
- 错误:syntax error near unexpected token `then'
- syntax error near unexpected token `then'
- “syntax error near unexpected token `then'”错误
- syntax error near unexpected token `then'
- 解决cygwin中的 syntax error near unexpected token问题
- syntax error near unexpected token ?怎么解决
- 解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
- linux shell脚本syntax error near unexpected token `then'
- shell if else 用法 syntax error near unexpected token `then'
- syntax error near unexpected token `
- Office for Mac 2016破解版
- SLAM学习资料
- 农夫过河
- 如何制作Android Splash界面
- 关于槽机制和connect函数
- syntax error near unexpected token `then'问题的解决
- iOS 笔试题01~[有答案]
- ReplaceBlank
- java编译时出现无法从静态上下文中引用非静态
- MySQL--操作数据表5:内连接,外连接,多表连接,无限级分类表设计
- JDK内置工具使用
- 微信小程序支付业务处理
- Kotlin起步
- Spring自定义标签