Hi all,
I've tried to search the forums for a way to do this. The simple script bellow might explain more or less what I'm trying to do:
A="Option A - Value is less than or equal to 500"
B="Option B - Value is more than 501 but less than 5000"
C="Option C - Value is more than 5001"
if [ "$NUMB" -le "500" ]
then
echo $A
fi
if [ "$NUMB" -ge "500" ]
then
echo $B
fi
if [ "$NUMB" -le "5000" ]
then
echo $C
fi
I've tried a nested approach also using elif but it won't work for obvious reasons. If choosing a value such as 600 then it will match $B and $C
So really what I'm after is something or a way to say , if its more than 500 but less than 5000 then equal $B
Hope that makes sense
Thanks
I've tried to search the forums for a way to do this. The simple script bellow might explain more or less what I'm trying to do:
A="Option A - Value is less than or equal to 500"
B="Option B - Value is more than 501 but less than 5000"
C="Option C - Value is more than 5001"
if [ "$NUMB" -le "500" ]
then
echo $A
fi
if [ "$NUMB" -ge "500" ]
then
echo $B
fi
if [ "$NUMB" -le "5000" ]
then
echo $C
fi
I've tried a nested approach also using elif but it won't work for obvious reasons. If choosing a value such as 600 then it will match $B and $C
So really what I'm after is something or a way to say , if its more than 500 but less than 5000 then equal $B
Hope that makes sense
Thanks