If I have a list in bash
L="11 22 11 33 22 44"
Is there a clean way to get to "11 22 33 44" ?
Using tr, the numbers are split to individual lines, and sort is used to sort the numbers(-n) and remove the duplicate ones(-u).
A common pattern in some other programming languages is to store each value as a 'key' in a hash or dictionary or associative array, and rely on the implementation to keep hash keys unique.