diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-11 00:09:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-11 00:09:24 +1300 |
commit | 960208a496240318b38a6a6cfdf1f5e266099c85 (patch) | |
tree | de7ff197a3514d3e0bcfa6acbfa748b2738c5692 /bin/rndi.awk | |
parent | Remove superfluous calls to next in sec(1df) (diff) | |
download | dotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.tar.gz dotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.zip |
Stylistic tweaks to awk scripts
Diffstat (limited to 'bin/rndi.awk')
-rw-r--r-- | bin/rndi.awk | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/rndi.awk b/bin/rndi.awk index 337498cb..49df4398 100644 --- a/bin/rndi.awk +++ b/bin/rndi.awk @@ -5,17 +5,15 @@ BEGIN { # Seed with the third argument if given - if (ARGV[3]) { + if (ARGV[3]) srand(ARGV[3]) - } # If not, just seed with what is probably a date/time-derived value - else { + else srand() - } # Print a random integer bounded by the first and second arguments - print int(ARGV[1]+rand()*(ARGV[2]-ARGV[1]+1)) + print int(ARGV[1] + rand() * (ARGV[2] - ARGV[1] + 1)) # Bail before processing any lines exit |