tr.1 (1210B)
1 .Dd January 16, 2015 2 .Dt TR 1 sbase\-VERSION 3 .Sh NAME 4 .Nm tr 5 .Nd translate characters 6 .Sh SYNOPSIS 7 .Nm tr 8 .Op Fl c | Fl C 9 .Op Fl sd 10 .Ar set1 set2 11 .Sh DESCRIPTION 12 .Nm 13 matches characters from stdin and performs translations to stdout. 14 .Sh OPTIONS 15 .Bl -tag -width Ds 16 .It Fl c | Fl C 17 Match to 18 .Ar set1 19 complement. 20 .It Fl d 21 Delete characters matching 22 .Ar set1 . 23 .It Fl s 24 Squeeze repeated characters matching 25 .Ar set1 26 or 27 .Ar set2 28 if -d is set. 29 .El 30 .Sh SET 31 .Bl -tag -width Ds 32 .It Literal 'c' 33 .It Escape sequence '\ec' 34 \e\e, \ea, \eb, \ef, \en, \er, \et, \ev 35 .It Range 'c-d' 36 .It Repeat '[c*n]' 37 Only in 38 .Ar set2 . 39 If n = 0 or left out, set n to length of 40 .Ar set1 . 41 .It Character class '[:class:]' 42 See 43 .Xr wctype 3 . 44 .El 45 .Sh TRANSLATION 46 If no options are specified, 47 .Nm 48 translates from 49 .Ar set1 50 to 51 .Ar set2 52 by index or character class. 53 .Pp 54 If 55 .Ar set2 56 is shorter than 57 .Ar set1 , 58 overflowing characters translate to the last character in 59 .Ar set2 . 60 .Sh EXIT STATUS 61 .Bl -tag -width Ds 62 .It 0 63 Input processed successfully. 64 .It 1 65 An error occurred. 66 .El 67 .Sh SEE ALSO 68 .Xr sed 1 , 69 .Xr awk 1 , 70 .Xr utf8 7 71 .Sh STANDARDS 72 The 73 .Nm 74 utility is compliant with the 75 .St -p1003.1-2008 76 except from octal sequences and equivalence classes.