From bf96d01b1159073aa0bb1031bae47ed387441a3d Mon Sep 17 00:00:00 2001 From: John D Pell Date: Wed, 8 Sep 2021 15:52:03 -0700 Subject: [PATCH] lib/utilities: fix `_bash-it-array-dedup()` Use fewer subprocesses and newline-delimited not space-delimited. --- lib/utilities.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utilities.bash b/lib/utilities.bash index d919004f..67099b78 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -55,7 +55,8 @@ _bash-it-array-contains-element() { # Dedupe a simple array of words without spaces. _bash-it-array-dedup() { - echo "$*" | tr ' ' '\n' | sort -u | tr '\n' ' ' + local IFS=$'\n' + echo "$@" | tr ' ' '\n' | sort -u } # Outputs a full path of the grep found on the filesystem