How should I change this to check whether val has an even or odd numeric value?
val
val=2 if $((RANDOM % $val)); ...
foo=6 if [ $((foo%2)) -eq 0 ]; then echo "even"; else echo "odd"; fi