You can use && for “and” and || for “or” to combine multiple conditions in shell if statement –
1 2 3 4 5 6 7 8 9 10 |
## Multiple conditions in shell if statement a=10 b=12 c=5 d=30 if [[ ( $a == 10 && $b == 12 ) || ( $c == 5 && $d == 30 ) ]];then echo "this is true" fi ## Returns this is true |