From: Chris Koeritz Date: Sat, 14 Oct 2017 17:56:18 +0000 (-0400) Subject: maybe a fix for uniquifier X-Git-Tag: 2.140.90~136 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=b98bf12c0cafdfb8e59c24f8824ff160f753fd72;p=feisty_meow.git maybe a fix for uniquifier turns out we were not using IFS properly. the real solution was to flip the spaces into EOLs so that uniq and other things would work on multiple lines. we believe this, at this point, at least. --- diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index af8a852f..90afe19c 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -83,16 +83,21 @@ 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. -echo "list before uniquify: $*" >~/uniquify.out - HOLDIFS="$IFS" - IFS=' ' +## # 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 $* | sort | uniq)" + local chewed="$(echo $* | tr ' ' '\n' | sort | uniq)" echo $chewed -echo "list after uniquify: $chewed" >~/uniquify.out - # return the former eol characters to their place. - IFS="$HOLDIFS" +echo "$(date): list after uniquify: $chewed" >>~/uniquify.out + +## # return the former eol characters to their place. +## IFS="$HOLDIFS" } # sets the variable in parameter 1 to the value in parameter 2, but only if