multiple if condition in bash
Hi,
how can I write this multiple condition in a bash script? Code:
if ((a > 30) || ((a < 0) && (b > 30))) then ... tikit |
You have to nest a double parenthesis construct like this:
Code:
if (( a > 30 || (( a < 0 && b > 30 )) )) ; then |
aargh...colucix got to it before I did.
|
Quote:
|
Thanks. It works!.
|
You appear to be trying to do numeric comparisons, in which case you're using the wrong operators. See http://www.tldp.org/LDP/abs/html/comparison-ops.html
:) |
Moin,
Quote:
Code:
((expression)) |
All times are GMT -5. The time now is 01:12 PM. |