BASH Syntax error near unexpected token 'done'

前端 未结 12 889
轮回少年
轮回少年 2020-12-01 05:52

Any idea of what the problem could be?

My code is:

#!/bin/bash
while :
do
echo \"Press [CTRL+C] to stop..\"
sleep 1
done

Saved it a

12条回答
  •  长情又很酷
    2020-12-01 06:01

    I was getting the same error on Cygwin; I did the following (one of them fixed it):

    1. Converted TABS to SPACES
    2. ran dos2unix on the .(ba)sh file

提交回复
热议问题