lib/utilities: fix `_bash-it-array-dedup()`
Use fewer subprocesses and newline-delimited not space-delimited.pull/1933/head
parent
fe102ff505
commit
bf96d01b11
|
|
@ -55,7 +55,8 @@ _bash-it-array-contains-element() {
|
||||||
|
|
||||||
# Dedupe a simple array of words without spaces.
|
# Dedupe a simple array of words without spaces.
|
||||||
_bash-it-array-dedup() {
|
_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
|
# Outputs a full path of the grep found on the filesystem
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue