Use the $RANDOM. $RANDOM returns a number between 0 and 32767.
To get a random number between 0 and 50 you can use
$ echo $[RANDOM%50]
$ # or
$ echo $((RANDOM%50))
To get a random number between 1 and 50 you can use
$ echo $[RANDOM%50+1]
$ # or
$ echo $((RANDOM%50+1))