An alternative POSIX solution:
if printf '%s' "$num" | grep -xE '(9|75|200)' >/dev/null; then
echo "do this"
elif printf '%s' "$num" | grep -xE '(40|53|63)' >/dev/null; then
echo "do something for this"
else
echo "for other do this"
fi
This is awfully slow ~50 times slower than the case option.
This is a shorter and I believe a simpler script, only twice the time of the case option:
#!/bin/sh
num="$1" a='9 75 200' b='40 53 63'
tnum() {
for arg
do [ "$arg" = "$num" ] && return 0
done return 1
}
if tnum $a; then
echo "do this"
elif tnum $b; then
echo "do something for this"
else
echo "for other do this"
fi
CAVEAT: No test [ "$arg" = "$num" ] will work in all cases, this fails on 00 = 0 for example.
And a numerical test [ "$arg" -eq "$num" ] will fail to match empty values [ "" -eq "" ].
You may choose what works better in your case.