On 21 Feb 2022 14:51, Joel Sherrill wrote: > Could this be de-duped with the gnu make sort command? That would avoid the > copy. > > Alternatively, I see some awk one liners on the web to uniq the set. Or > just invoke uniq. the inputs need to be deduped based on basename and the order specified. so i'd build a hashmap/associative array from the basename to the full path, and then output the resulting set. this isn't something sort/uniq can accomplish. it is possible to do in awk, i've just been a bit shy about using it as i'm not confident in portability aspects (beyond POSIX). if we agree POSIX is fine (which, for newlib, i think is OK), then yes, we can do that. -mike