other sections
TR(1plan9) | TR(1plan9) |
NAME¶
tr - translate charactersSYNOPSIS¶
tr [ -cds ] [ string1 [ string2 ] ]DESCRIPTION¶
Tr copies the standard input to the standard output with substitution or deletion of selected characters (runes). Input characters found in string1 are mapped into the corresponding characters of string2. When string2 is short it is padded to the length of string1 by duplicating its last character. Any combination of the options -cds may be used:- -c
- Complement string1: replace it with a lexicographically ordered list of all other characters.
- -d
- Delete from input all characters in string1.
- -s
- Squeeze repeated output characters that occur in string2 to single characters.
EXAMPLES¶
Replace all upper-case ASCII letters by lower-case.-
tr A-Z a-z <mixed >lower
-
tr -cs A-Za-z ' ' <file1 >file2