From: Chris Koeritz Date: Sat, 14 Oct 2017 17:59:50 +0000 (-0400) Subject: cleaned up debug, improved comments X-Git-Tag: 2.140.90~135 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=fe2ca090c0428d1def1c4ecfb00fdd02a948d089;p=feisty_meow.git cleaned up debug, improved comments --- diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 90afe19c..6572a486 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -83,21 +83,10 @@ if [ -z "$skip_all" ]; then # when passed a list of things, this will return the unique items from that list as an echo. function uniquify() { -## # change the eol character so things are easier. - -sep >>~/uniquify.out -echo "$(date): list before uniquify: $*" >>~/uniquify.out - -## HOLDIFS="$IFS" -## IFS=' ' - - # do the uniquification. - local chewed="$(echo $* | tr ' ' '\n' | sort | uniq)" - echo $chewed -echo "$(date): list after uniquify: $chewed" >>~/uniquify.out - -## # return the former eol characters to their place. -## IFS="$HOLDIFS" + # do the uniquification: split the space separated items into separate lines, then + # sort the list, then run the uniq tool on the list. results will be packed back onto + # one line when invoked like: local fredlist="$(uniquify a b c e d a e f a e d b)" + echo $* | tr ' ' '\n' | sort | uniq } # sets the variable in parameter 1 to the value in parameter 2, but only if