Skip to content

Instantly share code, notes, and snippets.

@M1ke
Last active December 29, 2015 14:09
Show Gist options
  • Save M1ke/7682017 to your computer and use it in GitHub Desktop.
Save M1ke/7682017 to your computer and use it in GitHub Desktop.
Generate a random number within a range
#!/bin/bash
# Generate a random number within a range
from=$1
to=$2
$(( ( RANDOM % $to ) + $from ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment