${(u)…}
: Deduplicate words
u
expands only the first occurrence of each word, i.e. it does not show duplicates in the result.
Links
Examples
- Deduplicate words of a string
- Output:
1 2 3 4 5 6
value="Genius is one percent inspiration and ninety-nine percent perspiration." IFS=" ." # deduplicate echo ${(u)=value} # deduplicate, upper-case, sort echo ${(uUo)=value}
1 2
Genius is one percent inspiration and ninety-nine perspiration AND GENIUS INSPIRATION IS NINETY-NINE ONE PERCENT PERSPIRATION
BashSupport Pro 是一款支持 u** 的 **Zsh 集成开发环境 - 立即试用!