${(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 6value="Genius is one percent inspiration and ninety-nine percent perspiration." IFS=" ." # deduplicate echo ${(u)=value} # deduplicate, upper-case, sort echo ${(uUo)=value}1 2Genius is one percent inspiration and ninety-nine perspiration AND GENIUS INSPIRATION IS NINETY-NINE ONE PERCENT PERSPIRATION
BashSupport Pro ist eine Zsh IDE mit Unterstützung für ${(u)…} - probieren Sie es jetzt aus!