BASH Syntax error near unexpected token 'done'

前端 未结 12 896
轮回少年
轮回少年 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:02

    Edit your code in any linux environment then you won't face this problem. If edit in windows notepad any space take it as ^M.

提交回复
热议问题