简体   繁体   English

bash:意外令牌'done'附近的语法错误

[英]bash: syntax error near unexpected token `done'

任何人都可以指出以下bash脚本中的错误

 for i in {0..127} ; do echo -n [$i] ; if [$i -eq 7]; then echo "\n" ; mytool-c "read 0x1540:0xa0:$i*$j" ; done

You are missing spaces in the if line. 您在if行中缺少空格。 It needs to be [ $i -eq 7 ] . 它必须是[ $i -eq 7 ] ( [ is a command.) [是命令。)

But your error is that you are missing the closing fi for the if . 但是,您的错误是您缺少if的结尾fi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM