Hello,
In a Bourne shell script I am lokking for a cleaner way to write an if with mutiple comparisons. Though the below works, how can I write it so as I can group the comparison's rather than relying on order of precedence?
In other laguages I have used parenthesis to group logic.
Example: if (DAY="Fri") AND (VALIDATE="Y" OR VALIDATE="y")
Thanks,
Michael42
In a Bourne shell script I am lokking for a cleaner way to write an if with mutiple comparisons. Though the below works, how can I write it so as I can group the comparison's rather than relying on order of precedence?
Code:
if [ "$DAY" = "Fri" -a "$VALIDATE" = "Y" -o "$VALIDATE = "y" ]; then
Do stuff...
fi
In other laguages I have used parenthesis to group logic.
Example: if (DAY="Fri") AND (VALIDATE="Y" OR VALIDATE="y")
Thanks,
Michael42