最佳答案
我有一个和 给你几乎相同的问题。
I have an array which contains aa ab aa ac aa ad
, etc.
现在我要从这个数组中选择所有唯一的元素。
Thought, this would be simple with sort | uniq
or with sort -u
as they mentioned in that other question, but nothing changed in the array...
The code is:
echo `echo "${ids[@]}" | sort | uniq`
我做错了什么?