This question already has answers here:
When to wrap quotes around a shell variable?
                                
                                    (5个答案)
                                
                        
                                在11个月前关闭。
            
                    
如标题所述,我只希望该行测试变量是否大于10但小于30,但返回的错误为“参数过多”

if [ -f myClass ] && grep 'John Smith' myclass > /dev/null

then cat myclass

elif [ -f grades ]

then

grep "s100" grades

elif
[ $ca82 -gt 10 -a $ca82 -lt 30 ]

then
echo "success"

else
echo "test 2"

fi

最佳答案

elif [ $ca82 -gt 10 ] && [ $ca82 -lt 30 ]


提供您在某处设置$ca82

08-27 02:04