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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
|
.\" This file documents the GNU text utilities.
.\"
.\" Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for modified
.\" versions, except that this permission notice may be stated in a
.\" translation approved by the Foundation.
.\"
.\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved.
.\" Translated Mon Jul 14 1997 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.TH TR 1 "GNU Text Utilities" "FSF" \" -*- nroff -*-
.SH ̾
tr \- ʸѴõ
.SH
.B tr
[\-cst] [\-\-complement] [\-\-squeeze\-repeats]
[\-\-truncate\-set1] string1 string2
.br
.B tr
{\-s,\-\-squeeze\-repeats} [\-c] [\-\-complement] string1
.br
.B tr
{\-d,\-\-delete} [\-c] string1
.br
.B tr
{\-d,\-\-delete} {\-s,\-\-squeeze\-repeats} [\-c] [\-\-complement]
string1 string2
.PP
GNU
.B tr
\-\-help \-\-version ץդ롣
.SH
ʸϤ⤦ƥʥƤʤΤǡΡԴ
ʲǽ롣ߤ texinfo ʸʾȤʤäƤ롣
.PP
Υޥ˥奢ڡ GNU
.BR tr
ˤĤƵҤΤǤ롣
.B tr
ɸϤɸϤ˥ԡ뤬κݤ˰ʲΤΤ줫Ԥ
.IP
\(bu ʸѴץǻꤹФϢ³ʸ
(squeeze) 롣
.br
\(bu Ϣ³ʸ̤롣
.br
\(bu ʸ롣
.br
\(bu ʸƤ顢Ϣ³ʸ̤롣
.PP
\fIstring1\fP (ͿƤ) \fIstring2\fP Ͻ
ʸΥåȤ롣ʲǤϤ set1 set2 ȸƤ֡
ʸåȤϤ¸ߤȡ
.B tr
ϤʸФưԤ
.I \-\-complement
(\fI\-c\fP) ץ set1 佸 (set1 ˴ޤޤʤʸ
) ִ롣
.SS ʸåȤλ
.PP
\fIstring1\fP \fIstring2\fP ΥեޥåȤɽȻ
ΤˤʤäƤ롣ɽΤΤǤϤʤ¤ʸ¤Ӥ
ʤʸ˵줿ʸϡۤȤɤξϤʸ
ȤؤʸˤصʲΤ褦û̷Ѥ뤳ȤǤ롣
\fIstring1\fP ޤ \fIstring2\fP Τ줫ˤѤ뤳Ȥ
ǤʤΤ⤢롣Ҥդ뤳ȡ
.PP
Хååˤ륨סʲʳʸХåå³
ϥ顼åФ롣
.IP \ea
Control-G
.IP \eb
Control-H
.IP \ef
Control-L
.IP \en
Control-J
.IP \er
Control-M
.IP \et
Control-I
.IP \ev
Control-K
.IP \eooo
\fIooo\fP (13 8 ʿ) ˤäƻꤵʸ
.IP \e\e
Хååʸ
.PP
ϰϻꡣ `\fIm\fP\-\fIn\fP' ȤäҤϡ \fIm\fP \fIn\fP
ǤΤ٤ƤʸŸʸˤʤ롣 \fIm\fP \fIn\fP
ˤʤФʤ餺ȿϥ顼Ȥʤ롣㤨 `0\-9'
`0123456789' ꤷΤƱȤˤʤ롣
System V Ǥ
.B tr
ǤϰϤꤹݤ˳ѳ `[]' Ѥ뤬
GNU
.BR tr
ǤϤηϥݡȤƤʤηˤѴ
string1 string2 δ֤dzѳ̤бƤͭǤ롣
.PP
֤ʸ \fIstring2\fP ˤ `[\fIc\fP*\fIn\fP]' Ȥä
\fIn\fP Ĥʸ \fIc\fP Ÿ롣ä `[y*6]'
`yyyyyy' ˤʤ롣 \fIstring2\fP ˤ `[\fIc\fP*]' set2 set1
ƱĹˤ뤿ɬפʸĿʸ \fIc\fP Ÿ롣
\fIn\fP 0 ǤϤޤ 8 ʿȤߤʤ졢ʳξ 10
Ȥߤʤ롣
.PP
ʸ饹 `[:\fIclass-name\fP:]' ȤäҤϤ餫줿
ʸ饹 \fIclass-name\fP Τ٤ƤʸŸ롣ʸ饹ˤ
νƤʤ `upper' `lower' 饹Τߤ
ǡŸ롣
.I \-\-delete
(\fI\-d\fP)
.I \-\-squeeze\-repeats
(\fI\-s\fP) ξꤵ줿ϡ \fIstring2\fP ˤϤɤʸ
饹ǤѤ뤳ȤǤ롣ʳξϡ \fIstring2\fP ˻
Τ `lower' `upper' Τߤǡ⤽줾б륯饹
(`lower' ˤ `upper' `upper' ˤ `lower') \fIstring1\fP Ʊ
֤˻ꤵƤʤФʤʤξʸʸѴ롣
ʸ饹̾ʲ˼ʳ̾ꤵ줿ˤϥ顼
ʤ롣
.IP alnum
ʸȿ
.IP alpha
ʸ
.IP blank
ʿζ (Horizontal whitespace)
.IP cntrl
ȥʸ
.IP digit
.IP graph
Ǥʸϴޤޤʤ
.IP lower
ʸ
.IP print
Ǥʸޤࡣ
.IP punct
.IP space
ʿӿľζ
.IP upper
ʸ
.IP xdigit
16 ʿʸ
.PP
饹 `[=\fIc\fP=]' ȤäҤ \fIc\fP ʸŸ
롣ΤȤʤ饹ϱѸʳΥե٥å
ݡȤ뤿˺Ƕȯ줿ΤǤ롣ߤΤȤ
ƻɸŪˡϤʤ褦Ǥ롣ä GNU
.BR tr
ǤⴰˤϼƤʤ줾ʸ饹Ϥʸ
Τ߹Ƥ롣äƤεǽϸߤΤȤΩʤ
.SS Ѵ
.PP
.B tr
\fIstring1\fP \fIstring2\fP ξꤵƤơ \-\-delete
(\fI\-d\fP) ץꤵƤʤˤѴԤ
.B tr
ϤΤ set1 ˤʸ set2 б֤ˤʸѴ롣
set1 ̵ʸϤΤޤϤ롣⤷ʸ set1 ˣʾ帽졢
set2 бʸ٤ƱǤʤˤϡǸʸȤ
롣㤨аʲĤΥޥɤǤ:
.RS
.nf
tr aaa xyz
tr a z
.fi
.RE
.PP
.B tr
ɤѤˡȤƤϡʸʸؤѴ롣
ʤǽǤ뤬ʲĤۤɼ
.RS
.nf
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
tr a-z A-Z
tr '[:lower:]' '[:upper:]'
.fi
.RE
.PP
.B tr
ѴԤݤˤϡ set1 set2 ̾ƱĹǤʤФʤʤ
set1 set2 ûˤϡ set2 ;̵뤵롣
.PP
դ set1 set2 Ĺꤹȡưͽ¬Ǥʤʤ롣 POSIX.2
ˤС̤ʤΤ褦ʾ硢 BSD
.B tr
Ǥ set2 ʤʬǸʸᡢ set1 ƱĹˤ롣
ޤ System V
.B tr
set1 ڤΤƤ set2 ƱĹˤ롣
.PP
ǥեȤǤ GNU
.B tr
BSD
.B tr
Ʊ褦˿
ޤ \-\-truncate\-set1 (\fI\-t\fP) ץꤵ줿ˤϡ
GNU
.B tr
System V
.B tr
Τ褦˿ΥץѴʳ˴ؤƤ̵뤵롣
.PP
System V
.B tr
ŪʿβǤϡ BSD Ǥͭ̾ˡ:
.RS
.nf
tr -cs A-Za-z0-9 '\e012'
.fi
.RE
ϻȤʤʤ롣ϥե٥åʸӿʳʸʸ
ִΤǤ뤬 System V ǤƤ 0 ΥХ (set1 佸
Ƭ) ΤߤѴ뤳Ȥˤʤ롣
.SS ֤ΰ̤Ⱥ
.PP
\-\-delete (\fI\-d\fP) ץꤵ줿ϡ
.B tr
ϤΤ set1 ˤʸ롣
.PP
\-\-squeeze\-repeats (\fI\-s\fP) ץꤵ줿ˤϡ
.B tr
ϤΤ set1 ˤʸη֤ʸ 1 ֤롣
.PP
\-\-delete \-\-squeeze\-repeats ξΥץꤵ줿
ˤϡ
.B tr
Ϥޤ set1 ˤʸĤΤ set2 ˤʸη֤
̤롣
.PP
The \-\-squeeze\-repeats ץѴȶѤ뤳ȤǤ롣
ˤ
.B tr
ϤޤѴԤĤʸΤ set2 ˤΤ̤롣
.PP
ʲˤΥץȤ߹碌:
.PP
Ƥ 0 ΥХȤ:
.RS
tr -d '\e000'
.RE
.PP
٤Ƥñ켫ȤΤߤʤԤѴ롣ʲϥե٥åʸ
ʳʸʸѴʸη֤Ĥβʸ
˰̤:
.RS
tr -cs '[a-zA-Z0-9]' '[\en*]'
.RE
.PP
ʸη֤ĤβʸѴ롣
.RS
tr -s '\en'
.RE
.PP
GNU
.B tr
ϡʲΥץ (¾ΤɤʥץȤȤ߹碌Ǥ) դ롣
.TP
.I "\-\-help"
Ȥ˴ؤåɸϤɽ¹֤ƽλ롣
.TP
.I "\-\-version"
СɸϤɽƽλ롣
.SS ٹå
.PP
Ķѿ POSIXLY_CORRECT ꤹȡ POSIX.2 Ȥθ̩ʸߴݾ
뤿ˡٹ𤪤ӥ顼åΤĤϤʤʤ롣
ʤаʲΤ褦ʾǽФåǤ롣
.PP
1.
.I \-\-delete
ץꤵƤꡢ
.I \-\-squeeze\-repeats
ꤵƤ餺 \fIstring2\fP ͿƤˤϡ GNU
.B tr
ϥǥեȤǤϻˡΥåɽƽλ롣ʤʤ餳ΤȤ
\fIstring2\fP ѤʤǤ롣 POSIX ʤˤС
ξ \fIstring2\fP ñ̵뤵ʤФʤʤ
ۤä̵뤹ΤɤʤͤȻפΤ
.PP
2. ޤ 8 ʿפꤵ줿硣㤨 \e400 ϼºݤ
\e40 ȿ 0 ¤ӤȲᤵ롣ʤʤ 8 ʿ 400 б
ХȤ¸ߤʤǤ롣
.PP
GNU
.B tr
BSD System V ȤθߴݾڤƤʤȤդ뤳ȡ
С POSIX ˤ [:alpha:] [=c=] [c*10] Ȥä
ߤᤵ褦ʥץ¸ߤʤޤ GNU
.B tr
Ƥ 0 ΥХȤưŪˤϺʤޤǤ UNIX ǤǤϡ
ΥХȤĤˡ¸ߤʤ
|