Use bash when using $RANDOM bashism

$RANDOM is only supported by bash, not by sh.
Merge pull request #991 from ranma42/fix-jay-sh-bashism

Use bash when using $RANDOM bashism