From: Steven Baltakatei Sandoval Date: Sat, 4 Mar 2023 00:44:18 +0000 (+0000) Subject: fix(unitproc/bkshuf):Init Bash PRNG before consuming lines X-Git-Tag: 0.8.2~11 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/57357d431490ee122e0ea781cd2959d385dec5c5?hp=8a4fc9ec681685229f902e2fe426fc7b3f851833 fix(unitproc/bkshuf):Init Bash PRNG before consuming lines - Note: v0.1.1 -> v0.1.2 --- diff --git a/unitproc/bkshuf b/unitproc/bkshuf index e41d725..d2d0763 100644 --- a/unitproc/bkshuf +++ b/unitproc/bkshuf @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Desc: Mixes input lines while also preserving some neighbors # Usage: cat file | bkshuf arg1 -# Version 0.1.1 +# Version 0.1.2 # Depends: bc 1.07.1, GNU Coreutils 8.32 (shuf) # Input: var: arg1 initial lines to output @@ -161,6 +161,7 @@ main() { lc_out="0"; # init output line counter if [[ -z "$lc_out_max" ]]; then lc_out_max="$lco"; fi; ip="$(shuf -i0-$(( lco - 1 )) -n1)"; # init input index pointer + RANDOM="$(shuf -i0-32767 -n1)"; # init Bash PRNG n_loop1="0"; #yell "DEBUG:max_blanks:$max_blanks" while [[ $lcr -ge 1 ]] && [[ $lc_out -lt $lc_out_max ]]; do