randint: give random integer

master
neingeist 5 years ago
parent 5278d799b4
commit b1aba7038f

@ -0,0 +1,7 @@
#!/bin/sh
# Give a random integer between 1 and $1 inclusive
min=1
max=${1:-10}
rand=$((RANDOM % (max-min+1) + min))
echo "$rand"
Loading…
Cancel
Save