I\'m running a switch case with column numbers which can be in the range 0 - 50. Now each case supports discrete column number and I observe its failure.
Here is the cod
Bash case
doesn't work with numbers ranges. []
is for shell patterns.
for instance this case [1-3]5|6)
will work for 15 or 25 or 35 or 6.
Your code should look like this:
i=10
a=1
b=0.65
if [ "$a" != "$b" ] ; then
case $i in
1|2|5) echo "Not OK"; ;;
9|10|12) echo "may be ok"; ;;
*) echo "no clue - $i"; ;;
esac;
fi
If i
can be real
between 9 and 10 then you'll need to use if
(instead of case) with ranges.