| <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 – 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>−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>−cds</font></tt> may be used:<br> |
| <tt><font size=+1>−c</font></tt> Complement <i>string1</i>: replace it with a lexicographically ordered |
| list of all other characters.<br> |
| <tt><font size=+1>−d</font></tt> Delete from input all characters in <i>string1</i>.<br> |
| <tt><font size=+1>−s</font></tt> 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>−</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−Z a−z <mixed >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 −cs A−Za−z '<br> |
| ' <file1 >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> |