shell脚本中 unary operator expected解决办法

if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ];
then
        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi

解决方案如下:

if [ "$USER" = "oracle" ]; then
    if [ "$SHELL" = "/bin/ksh" ]; then

        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi


或者

if [ [$USER  = "oracle" ]]; then
    if [ [$SHELL" = "/bin/ksh] ]; then

        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi

你可能感兴趣的:(expected,operator,unary)