jeudi 21 mai 2020

How to evaluate using logical or and logical and operator when three expressions are used

I tried below but it doesn't work. Throwing some errors. Exp1 or expr2 should evaluate first & at result should be evaluated with expr3 ( &&)

    If [ [ "$val1" == "$val2" || "$val1" == "$val3" ] ]  && [ "$val4" > "$val5" ]
then
Echo "success"
Elif [ [ "$val1" == "$val2" || "$val1" == "$val3" ] ]  && [ "$val4" < "$val5" ]
Then
Echo "fail"
Else
Echo "no result"
Fi
Fi

Aucun commentaire:

Enregistrer un commentaire