source: trunk/minix/man/man1/tr.1@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.1 KB
Line 
1.TH TR 1
2.SH NAME
3tr \- translate character codes
4.SH SYNOPSIS
5\fBtr\fR [\fB\-cds\fR]\fR [\fIstring1\fR] [\fIstring2\fR]\fR
6.br
7.de FL
8.TP
9\\fB\\$1\\fR
10\\$2
11..
12.de EX
13.TP 20
14\\fB\\$1\\fR
15# \\$2
16..
17.SH OPTIONS
18.FL "\-c" "Complement the set of characters in \fIstring1\fR"
19.FL "\-d" "Delete all characters specified in \fIstring1\fR"
20.FL "\-s" "Squeeze all runs of characters in \fIstring1\fR to one character"
21.SH EXAMPLES
22.EX "tr \(fmA\-Z\(fm \(fma\-z\(fm <x >y " "Convert upper case to lower case"
23.EX "tr \-d \(fm0123456789\(fm <f1 >f2 " "Delete all digits from \fIf1\fR"
24.SH DESCRIPTION
25.PP
26.I Tr
27performs simple character translation.
28When no flag is specified, each character in
29.I string1
30is mapped onto the corresponding character in
31.I string2 .
32.PP
33There are two types of
34.I tr
35out there, one that requires [ and ] for character classes, and one that does
36not. Here is what the example above would look like for a
37.I tr
38that needs the brackets:
39.PP
40.RS
41.B "tr \(fm[A\-Z]\(fm \(fm[a\-z]\(fm <x >y"
42.RE
43.PP
44Use [ and ] if you want to be portable, because a
45.I tr
46that doesn't need them will still accept the syntax and mindlessly
47translate [ into [ and ] into ].
Note: See TracBrowser for help on using the repository browser.