[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Find duplicates in a list
From: |
Sam Ravnborg |
Subject: |
Re: Find duplicates in a list |
Date: |
Mon, 28 Jul 2014 13:13:48 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Jul 28, 2014 at 04:09:12AM -0700, Rakesh Sharma wrote:
> Hi Sam,
>
> LISTx := A A B C D D E
> LISTd := $(strip \
> $(foreach v,$(sort $(LISTx)),\
> $(if $(filter-out 1,$(words $(filter $(v),$(LISTx)))),\
> $(v))))
> $(info My make version=$(MAKE_VERSION))
> $(info Original list => $(LISTx))
> $(info Duplicates list => $(LISTd))
>
>
> This gives out the following:
>
> My make version=4.0
> Original list => A A B C D D E
> Duplicates list => A D
Thanks - matches my needs perfectly.
I like this better than the version I posted in another mail - it looks more
robust.
Sam