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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章