9.1.3 Squeezing repeats and deleting

When given just the --delete (-d) option, tr removes any input characters that are in array1.

When given just the --squeeze-repeats (-s) option and not translating, tr replaces each input sequence of a repeated character that is in array1 with a single occurrence of that character.

When given both --delete and --squeeze-repeats, tr first performs any deletions using array1, then squeezes repeats from any remaining characters using array2.

The --squeeze-repeats option may also be used when translating, in which case tr first performs translation, then squeezes repeats from any remaining characters using array2.

Here are some examples to illustrate various combinations of options: