Skip to content

Instantly share code, notes, and snippets.

@aholmes
Created January 10, 2015 20:35
Show Gist options
  • Save aholmes/3b6efde3cc3618a9814a to your computer and use it in GitHub Desktop.
Save aholmes/3b6efde3cc3618a9814a to your computer and use it in GitHub Desktop.
Random number with MIN and MAX in Bash
#!/bin/bash
MIN=$1
MAX=$2
NUM=$(( ( RANDOM % ( MAX - MIN + 1 ) + MIN ) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment