3 tr \- translate character codes
5 \fBtr\fR [\fB\-cds\fR]\fR [\fIstring1\fR] [\fIstring2\fR]\fR
20 # Complement the set of characters in \fIstring1\fR
23 # Delete all characters specified in \fIstring1\fR
26 # Squeeze all runs of characters in \fIstring1\fR to one character
29 .B tr \(fmA\-Z\(fm \(fma\-z\(fm <x >y
30 # Convert upper case to lower case
32 .B tr \-d \(fm0123456789\(fm <f1 >f2
33 # Delete all digits from \fIf1\fR
37 performs simple character translation.
38 When no flag is specified, each character in
40 is mapped onto the corresponding character in
43 There are two types of
45 out there, one that requires [ and ] for character classes, and one that does
46 not. Here is what the example above would look like for a
48 that needs the brackets:
51 .B "tr \(fm[A\-Z]\(fm \(fm[a\-z]\(fm <x >y"
54 Use [ and ] if you want to be portable, because a
56 that doesn't need them will still accept the syntax and mindlessly
57 translate [ into [ and ] into ].
59 MINIX tr supports the following character classes: alnum, alpha, digit, lower,
60 upper and xdigit. If any of these keywords is encountered between backets and
61 colons, it is replaced by respectively alphanumeric characters, alphabetic
62 characters, decimal digits, lowercase letters, uppercase letters and
63 hexadecimal digits. The following are equivalent with the given examples:
65 .B tr \(fm[:upper:]\(fm \(fm[:lower:]\(fm <x >y
66 # Convert upper case to lower case
68 .B tr \-d \(fm[:digit:]\(fm <f1 >f2
69 # Delete all digits from \fIf1\fR