Solved need multiple operators in 1 statement

April 23, 2013 at 15:04:21
Specs: Windows Vista
Im looking to use an integer operator in an 'if' loop statement. I need the math to read say that X is less than Y but greater than Z. So basically, z > x> y

See More: need multiple operators in 1 statement

Report •

#1
April 23, 2013 at 16:51:17
✔ Best Answer
This only works with integer arithmetic:

#!/bin/ksh

z=4
x=5
y=6

if [[ $x -gt $z && $x -lt $y ]]
then
  echo "x is greater than z and x is less than y"
fi


Report •
Related Solutions


Ask Question