✨ randint: give random integer
This commit is contained in:
parent
5278d799b4
commit
b1aba7038f
1 changed files with 7 additions and 0 deletions
7
randint
Executable file
7
randint
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue