tr.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 78 行
1
78 行
.\" SCCSID: @(#)tr.1 8.1 9/11/90.TH tr 1 .SH Nametr \- translate characters.SH Syntax.B tr[\fB\-cds\fR] [\|\fIstring1\|\fR[\fIstring2\fR\|]\|].SH Description.NXR "tr command".NXR "character" "translating"The.PN trcommand copies the standard input to the standard output with substitution or deletion of selected characters.Input characters found in .I string1are mapped into the corresponding characters of.IR string2 .When .I string2is short it is padded to the length of .I string1by duplicating its last character.Any combination of the options.B \-cdsmay be used:.B \-ccomplements the set of characters in.I string1with respect to the universe of characterswhose ASCII codes are 0 through 0377 octal;.B \-ddeletes all input characters in.I string1;.B \-ssqueezes all strings of repeated output characters that arein .I string2to single characters..PPIn either string the notation.IB a \- bmeans a range of characters from.I ato.I bin increasing ASCII order.The backslash character(\\) followed by 1, 2 or 3 octal digits stands for thecharacter whose ASCII code is given by those digits.A \\ followed by any other character standsfor that character..PPThe following example creates a list of allthe words in `file1' one per line in `file2',where a word is taken to be a maximal string of alphabetics.The second string is quotedto protect \\ from the Shell.012 is the ASCII code for newline..EXtr \-cs A\-Za\-z \'\\012\' <file1 >file2.EE.SH Options.IP \fB\-c\fR 5Translates complements: string1 to those not in string1..IP \fB\-d\fR Deletes all characters in string1 from output..IP \fB\-s\fR Squeezes succession of a character in string1 to one in output. .SH Restrictions\`\\0', `\\00', and `\\000' are equivalent for NUL character..PP\`\\012' istreated as octal 12 and not a NUL followed by characters 1 and 2..SH See Alsoed(1), ascii(7), expand(1)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?