Bash IF : multiple conditions
问题 I've been trying to make this thing work for a couple of hours but I can't get it to work : if [ "$P" = "SFTP" -a "$PORT" != "22" ] || [ "$P" = "FTPS" && [ "$PORT" != "990" -a "$PORT" != "21" ] ] ; then Can someone help me ? I know that multiple conditions can be written like this : if [ "$P" = "SFTP" ] && [ "$PORT" != "22" ]; then but how can I imbricate theses conditions like in my first example? 回答1: You can't nest expressions in single brackets. It should be written like this: if [ "$P" =