diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-07-29 10:36:01 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-07-29 10:36:01 -0400 |
commit | af303b9fe0143ef3c9aae97df0090eec22938aef (patch) | |
tree | f4e67110b008b97e44e96a5b919ccbe892499bba /shuf.sh | |
parent | 4c16e777b2994a0aa962a9e7bc1bda7e4f8676fd (diff) |
call srand() to seed PRNG
Diffstat (limited to 'shuf.sh')
-rw-r--r-- | shuf.sh | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -7,6 +7,7 @@ exec awk "$(tail -n +2 $0)" "$@" END { nprinted = 0; + srand(); while (nprinted < NR) { line = int(rand() * NR); if (!printed[line]) { |