Ubuntu run control.sh with: "Syntax error: Bad for loop variable"
zhugelianglongming opened this issue · comments
Brief of the issue
Run control.sh with error: Syntax error: Bad for loop variable
Your environment
- XuperChain: v5.3.0
- OS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1023-azure x86_64)
- Go: go1.18.1 linux/amd64
- Gcc: 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
Repo steps
- Download Xuperchain v5.3.0
make && make testnet
cd testnet/node*
sh control.sh start
Expected behaviours
...
start finish.pid:<PID>
Done!
What actually happened
Syntax error: Bad for loop variable
Picture shows script run with
set -x
Additional information
Fix problem by bash control.sh start
Problem cause and solution: Syntax error: Bad for loop variable错误解决方法
Ubuntu下的sh命令是软连接到 /bin/dash,但是启动脚本里用的/bin/bash,所以你可以用bash control.sh start启动试试。
Ubuntu下的sh命令是软连接到 /bin/dash,但是启动脚本里用的/bin/bash,所以你可以用bash control.sh start启动试试。
对的,我也是这么解决的