循环脚本错误

时间:2017-05-30 13:32:12

标签: bash

while true; do
    java -Xmx512M -jar spigot.jar
    echo 'Press any key to exit...'
    if read -r -N 1 -t 5; then
        break
    fi
done

我收到此错误:

./start.sh: line 7: syntax error near unexpected token `done'
./start.sh: line 7: `done'
  • 我安装了Bash

  • 此代码在另一台计算机上正常运行

1 个答案:

答案 0 :(得分:0)

发现原因,因为我在Windows计算机上制作该文件,该文件为msdos格式,因此无法正常工作