gnu make https://www.gnu.org/software/make/manual/make.html#toc-Functions-for-Transforming-Text has sort function. The description for the sort function states that sort function
Sorts the words of list in lexical order, removing duplicate words. The output is a list of words separated by single spaces.
I created a test makefile like this
TEST="this is a test test test test test"
all:
@echo $(sort $(TEST))
My output is This is a test test
The duplicates were not entirely removed from the string! Am I interpreting the sort function incorrectly? Or is it a bug with gnu make?
"This is a test test test test"
becomes"This is a test test"
which the shell prints asThis is a test test
. – Betasort
doesn't sort within a quoted string, but does remove duplicates therein... – BetaTEST
variable contains 5 different words:"this
,is
,a
,test
andtest"
. And only thetest
word is duplicated. – Renaud Pacalet