Skip to content

Instantly share code, notes, and snippets.

@tomaskavalek
Created November 6, 2020 11:00
Show Gist options
  • Save tomaskavalek/bab3dd4a09b4f955a3bbba040e93cee0 to your computer and use it in GitHub Desktop.
Save tomaskavalek/bab3dd4a09b4f955a3bbba040e93cee0 to your computer and use it in GitHub Desktop.
Bash – Get random number in interval
#!/bin/bash
# Get random number 0–5
local RANDOM_NUMBER=$(grep -m1 -ao '[0-5]' /dev/urandom | head -n1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment