diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 10:23:34 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 10:23:34 +1200 |
commit | a88bc7eefae9c0d187b2d41f3ff5e593b05239ad (patch) | |
tree | 8546b96e6fb570116e0cecd5362f553f8389b408 /bin/rndi | |
parent | Change sue(8) to POSIX sh (diff) | |
download | dotfiles-a88bc7eefae9c0d187b2d41f3ff5e593b05239ad.tar.gz dotfiles-a88bc7eefae9c0d187b2d41f3ff5e593b05239ad.zip |
Add rndi(1)
Diffstat (limited to 'bin/rndi')
-rwxr-xr-x | bin/rndi | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/rndi b/bin/rndi new file mode 100755 index 00000000..3b0ea005 --- /dev/null +++ b/bin/rndi @@ -0,0 +1,9 @@ +#!/usr/bin/awk -f +# Get a low-quality random number between two integers. Note that depending on +# implementation, this might return the same number if run in the same second. +# It's only for trivial purposes. +BEGIN { + srand() + print int(ARGV[1]+rand()*(ARGV[2]-ARGV[1]+1)) + exit +} |