Linux 条件表达式中的语法错误

Linux 条件表达式中的语法错误,linux,shell,while-loop,Linux,Shell,While Loop,我尝试: 我得到: while [[ $c -le $n]] do now=$(date +"%T") echo "Tps at :- $now" @c=$c+1 done 有人能找出问题所在吗?在关闭测试表达式之前需要一个空格 syntax error in conditional expression syntax error near `do' while [[ $c -le

我尝试:

我得到:

        while [[ $c -le $n]]
        do
        now=$(date +"%T")
        echo "Tps at :- $now"
        @c=$c+1
        done

有人能找出问题所在吗?

在关闭测试表达式之前需要一个空格

   syntax error in conditional expression

   syntax error near `do'
while [[ $c -le $n ]]
并用“”环绕变量,以避免出现令人痛苦的错误:

while [[ "$c" -le "$n" ]]