X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/db51b505288f4060d8a3de1ed419263b50428e51..6801e454e89cb21ea0ccb2a9d0b4959f46440b0c:/unitproc/bkt-decimate?ds=sidebyside diff --git a/unitproc/bkt-decimate b/unitproc/bkt-decimate index 47db83f..855ab0c 100644 --- a/unitproc/bkt-decimate +++ b/unitproc/bkt-decimate @@ -2,7 +2,7 @@ decimate() { # Desc: Randomly remove 10% of stdin lines - # Depends: GNU Coreutils 8.32 (shuf) + # Depends: Bash 5.1.16; GNU Coreutils 8.32 (shuf, nl, head, sort, cut) # Version: 0.0.1 # Read lines @@ -12,6 +12,7 @@ decimate() { lc="${#lines[@]}"; lk="$((lc * 900 / 1000))"; + # Output printf "%s\n" "${lines[@]}" | \ nl -w1 -s' ' | \ shuf | \