tr |
---|
Usage
|
---|
|
To transliterate characters. For example, converting uppercase characters to lowercase. Options let you remove characters and compress runs of identical characters. |
---|
|
-c |
---|
Complement the values in source-char-list. The characters that tr translates then become those that are not in source-char-list. This option is usually used with one of -d or -s. |
---|
-C |
---|
Like -c but work on (possibly multibyte) characters, not binary byte values. See Caveats. |
---|
-d |
---|
Delete characters in source-char-list from the input instead of transliterating them. |
---|
-s |
---|
"Squeeze out" duplicate characters. Each sequence of repeated characters listed in source-char-list is replaced with a single instance of that character. |
---|
Behavior |
---|
Acts as a filter, reading characters from standard input and writing them to standard output. Each input character in source-char-list is replaced with the corresponding character in replace-char-list. POSIX-style character and equivalence classes may be used, and tr also supports a notation for repeated characters in replace-char-list. See the manual pages for tr(1) for the details on your system. |
---|
Caveats |
---|
According to POSIX, the -c option operates on the binary byte values, whereas -C operates on characters as specified by the current locale. As of early 2005, many systems don't yet support the -C option. |
---|
Example
|
---|