< Day Day Up > |
tr ” translates characterstr [ cds ] [ string1 [ string2 ] ] tr copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found in string1 are mapped into the corresponding characters of string2 . The forward slash can be used with an octal digit to represent the ASCII code. When string2 (with any repetitions of characters) contains fewer characters than string1 , characters in string1 with no corresponding character in string2 are not translated. Octal values for characters may be used when preceded with a backslash:
Example A.63.1 tr 'A' 'B' < filex 2 tr '[A-Z]' [a-z]' < filex 3 tr -d ' ' < filex 4 tr -s '' '' < filex 5 tr -s ':' ' ' < filex 6 tr '7' '2' EXPLANATION
|
< Day Day Up > |