|
|
1.1 root 1: .TH TR 1
2: .CT 1 shell
3: .SH NAME
4: tr \- translate characters
5: .SH SYNOPSIS
6: .B tr
7: [
8: .B -cds
9: ]
10: [
11: .I string1
12: [
13: .I string2
14: ]
15: ]
16: .SH DESCRIPTION
17: .I Tr
18: copies the standard input to the standard output with
19: substitution or deletion of selected characters.
20: Input characters found in
21: .I string1
22: are mapped into the corresponding characters of
23: .IR string2 .
24: When
25: .I string2
26: is short it is padded to the length of
27: .I string1
28: by duplicating its last character.
29: Any combination of the options
30: .B -cds
31: may be used:
32: .TP
33: .B -c
34: Complement
35: .IR string1 :
36: replace it with a lexicographically ordered
37: list of all other 8-bit unsigned characters.
38: .TP
39: .B -d
40: Delete from input all characters in
41: .IR string1 .
42: .TP
43: .B -s
44: Squeeze repeated output characters that occur in
45: .I string2
46: to single characters.
47: .PP
48: In either string a noninitial sequence
49: .BI - x,
50: where
51: .I x
52: is any character (possibly quoted), stands for
53: a range of characters:
54: a possibly empty sequence of codes running from
55: the successor of the previous code up through
56: the code for
57: .I x.
58: The character
59: .L \e
60: followed by 1, 2 or 3 octal digits stands for the
61: character whose
62: .SM ASCII
63: code is given by those digits.
64: A
65: .L \e
66: followed by any other character stands
67: for that character.
68: .SH EXAMPLES
69: .TP
70: .B tr A-Z a-z <mixed >lower
71: Replace all upper-case letters by lower-case.
72: .EX
73: tr -cs A-Za-z '
74: \&' <file1 >file2
75: .EE
76: .ns
77: .IP
78: Create a list of all
79: the words in
80: .L file1
81: one per line in
82: .LR file2 ,
83: where a word is taken to be a maximal string of alphabetics.
84: .I String2
85: is given as a quoted newline.
86: .SH "SEE ALSO"
87: .IR ed (1),
88: .IR ascii (6)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.