syntax error near unexpected token `then'问题的解决

来源:互联网 发布:软件可行性研究 编辑:程序博客网 时间:2024/05/16 15:07

刚刚开始学shell

#!/bin/bash

echo -n Count:

tput sc


count-0;

while true;

do

if [ $count -lt 40 ];

then

 let count++;

 sleep 1;

 tput rc

 tput ed

 echo -n $count;

else exit 0;

 if

done

if和[之间没有空格会报错syntax error near unexpected token `then'

0 0