66 lines
840 B
Plaintext
66 lines
840 B
Plaintext
|
|
|
|
|
|
|
|
|
|
Command: tr - translate character codes
|
|
Syntax: tr [-cds] [string1] [string2]
|
|
Flags: -c Complement the set of characters in string1
|
|
-d Delete all characters specified in string1
|
|
-s Squeeze all runs of characters in string1 to one
|
|
character
|
|
Examples: tr '[A-Z]' '[a-z]' <x >y # Convert upper case to lower
|
|
case
|
|
tr -d '0123456789' <f1 >f2 # Delete all digits from f1
|
|
|
|
Tr performs simple character translation. When no flag is
|
|
specified, each character in string1 is mapped onto the corresponding
|
|
character in string2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|