aboutsummaryrefslogtreecommitdiff
path: root/man/man1/tr.html
blob: dc827b3f38d97d0f45760ca22f5684e2e3d21b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<head>
<title>tr(1) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>TR(1)</b><td align=right><b>TR(1)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    tr &ndash; translate characters<br>
    
</table>
<p><font size=+1><b>SYNOPSIS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>tr</font></tt> [ <tt><font size=+1>&#8722;cds</font></tt> ] [ <i>string1</i> [ <i>string2</i> ] ]<br>
    
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <i>Tr</i> copies the standard input to the standard output with substitution
    or deletion of selected characters (runes). Input characters found
    in <i>string1</i> are mapped into the corresponding characters of <i>string2</i>.
    When <i>string2</i> is short it is padded to the length of <i>string1</i> by
    duplicating its last character. Any combination of the
    options <tt><font size=+1>&#8722;cds</font></tt> may be used:<br>
    <tt><font size=+1>&#8722;c</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Complement <i>string1</i>: replace it with a lexicographically ordered
    list of all other characters.<br>
    <tt><font size=+1>&#8722;d</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Delete from input all characters in <i>string1</i>.<br>
    <tt><font size=+1>&#8722;s</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Squeeze repeated output characters that occur in <i>string2</i> to
    single characters. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    In either string a noninitial sequence <tt><font size=+1>&#8722;</font></tt><i>x</i>, where <i>x</i> is any character
    (possibly quoted), stands for a range of characters: a possibly
    empty sequence of codes running from the successor of the previous
    code up through the code for <i>x</i>. The character <tt><font size=+1>\</font></tt> followed by 1,
    2 or 3 octal digits stands for the character whose 16-bit
    value is given by those digits. The character sequence <tt><font size=+1>\x</font></tt> followed
    by 1, 2, 3, or 4 hexadecimal digits stands for the character whose
    16-bit value is given by those digits. A <tt><font size=+1>\</font></tt> followed by any other
    character stands for that character.<br>
    
</table>
<p><font size=+1><b>EXAMPLES     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    Replace all upper-case ASCII letters by lower-case.<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        <tt><font size=+1>tr A&#8722;Z a&#8722;z &lt;mixed &gt;lower<br>
        
        <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
        </font></tt>
        
    </table>
    Create a list of all the words in <tt><font size=+1>file1</font></tt> one per line in <tt><font size=+1>file2</font></tt>,
    where a word is taken to be a maximal string of alphabetics. <i>String2</i>
    is given as a quoted newline.<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        <tt><font size=+1>tr &#8722;cs A&#8722;Za&#8722;z '<br>
        ' &lt;file1 &gt;file2<br>
        </font></tt>
    </table>
    
</table>
<p><font size=+1><b>SOURCE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/usr/local/plan9/src/cmd/tr.c<br>
    </font></tt>
</table>
<p><font size=+1><b>SEE ALSO     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man1/sed.html"><i>sed</i>(1)</a><br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>