我该如何将以下if语句合并为一行?
我正在使用ksh。为什么会出现错误?
if [ $# -eq 4 ]
then
if [ "$4" = "PREV" ]
then
print "yes"
fi
fi
if [ $# -eq 3 ]
then
if [ "$3" = "PREV" ]
then
print "yes"
fi
fi
我正在使用ksh。为什么会出现错误?
if [ [ $# -eq 4 ] && [ "$4" = "PREV" ] ]
then
print "yes"
fi
错误:
0403-012 测试命令参数无效。