aboutsummaryrefslogtreecommitdiff
path: root/bin/rndi.awk
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-11 00:09:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-11 00:09:24 +1300
commit960208a496240318b38a6a6cfdf1f5e266099c85 (patch)
treede7ff197a3514d3e0bcfa6acbfa748b2738c5692 /bin/rndi.awk
parentRemove superfluous calls to next in sec(1df) (diff)
downloaddotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.tar.gz
dotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.zip
Stylistic tweaks to awk scripts
Diffstat (limited to 'bin/rndi.awk')
-rw-r--r--bin/rndi.awk8
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