X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/db51b505288f4060d8a3de1ed419263b50428e51..35ccc7696545160b3d4249e0e3c5a11a37742d28:/unitproc/bkt-decimate 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 | \