The question is contents of the variable $TEST are equal to the string “success, or the number 5 or the contents of the variable $RESULT
The code that I write is [ $TEST=”success” -o $TEST -eq ”5” -o $TEST = “$RESULT” ], but when in the linux there saying that bash: [ too many argument. Can someone help me
Advertisement
Answer
You will need || for this, to represent or and so:
if [[ "$TEST"==”success” || "$TEST"==”5” || "$TEST" == “$RESULT” ]] then echo "match" else echo "No match" fi