aboutsummaryrefslogtreecommitdiff
path: root/bin/rndl.awk
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rndl.awk')
-rw-r--r--bin/rndl.awk5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/rndl.awk b/bin/rndl.awk
index 925235ee..99f5b4e1 100644
--- a/bin/rndl.awk
+++ b/bin/rndl.awk
@@ -6,10 +6,13 @@ BEGIN {
# Name self
self = "rndl"
- # Seed the random number generator
+ # Get a random seed if rnds(1df) available
rnds = "rnds 2>/dev/null"
rnds | getline seed
close(rnds)
+
+ # Truncate the seed to 8 characters because mawk might choke on it
+ seed = substr(seed,1,8)
if (length(seed))
srand(seed + 0)
else