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
|
.\" Copyright (c) 1998 Andries Brouwer
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
.\" Translated Wed 12 Aug 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.\"WORD: wild card pattern 磻ɥɥѥ
.\"WORD: character class ʸ饹
.\"WORD: range ΰ
.\"WORD: complementation 佸
.\"WORD: regular expression ɽ
.\"WORD: bracket expression ֥饱åɽ
.\"WORD: collating sequence ȹ
.\"WORD: collating element ȹ
.\"WORD: current locale ȥ
.\"WORD: equivalence class 饹
.\"
.TH GLOB 7 "12 June 1998" "Unix" "Linux Programmer's Manual"
glob \- ѥ̾ glob
.SH
फफ Unix V6 λ塢磻ɥɥѥŸ
.I /etc/glob
ȸץबäθ夹ˡ
εǽϥȤ߹ޤ褦ˤʤä
Ǥϡεǽ桼ץफ¹ԤǤ褦
.BR glob (3)
Ȥ饤֥롼¸ߤƤ롣
glob ε§ʲ˽Ҥ٤ (POSIX 1003.2 3.13)
.SH 磻ɥɥޥå
ʸ `?', `*', `[' ޤޤƤȡϥ磻ɥɥѥ
Ȥߤʤ롣glob פȤΤϡ磻ɥɥѥŸ
ơΥѥ˥ޥåѥ̾ΥꥹȤ뤳ȤǤ롣ޥåϰ
Τ褦롣
(֥饱åȳ) `?' Ϥñʸ˥ޥå롣
(֥饱åȳ) `*' Ϥʸ˥ޥå롣ʸ (empty
string) ˤޥå롣
.SS "ʸ饹 (character class)"
`[...]' ȸɽϡƬ `[' ³ǽʸ `!' ǤʤС
饱åȤ˴ޤޤƤʸΤɤ줫Ĥ˥ޥå롣֥饱åȤ
˴ޤޤʸ϶ǤäƤϤʤʤäơ `]' ⡢ǽ
ʸ˻ꤹХ֥饱åȤ˴ޤ뤳ȤǤ롣 (Ĥޤ `[][!]'
`[', `]', `!' 3 ʸΤɤ줫˥ޥå롣)
.SS "ΰ (range)"
üɽˡĤ¸ߤ롣 `\-' ĤʸϡΰȤ
롣 (Ĥޤ `[A\-Fa\-f0\-9]' `[ABCDEFabcdef0123456789]' Ȥ
롣) `\-' ʸΤΤ줿ϡ֥饱åȤƬޤϺǸ
ʸ˻ꤹФ褤 (Ĥޤ `[]\-]' Ĥʸ `]' `\-' ˥ޥ
`[\-\-/]' `\-', `.', `/' 3 ʸ˥ޥå롣)
.SS 佸 (complementation)
`[!...]' ȸɽϡ֥饱åȤ˴ޤޤʤñʸ˥ޥå
(Ƭˤ `!' Ͻ) (Ĥޤ `[!]a\-]' `]', `a',
`\-' ʳΤ٤ƤʸΡɤ줫Ĥ˥ޥå롣
Хåå `\e' ֤С `?', `*', `[' ̾ʸȤ
롣ޤϥΥޥɥ饤ΰ˻ꤹϡ
ǰϤäƤƱ̤롣֥饱åȤǤϡʸϤ
ʸȤ̣롣ʤ `[[?*\e]' `[', `?', `*', `\e' Τ
줫ʸ˥ޥå롣
.SH "ѥ̾ (pathname)"
glob ưϡѥ̾Τ줾ʬΩŬѤ롣ѥ̾¸ߤ
`/' `?' `*' 磻ɥɤˤϥޥåʤޤ `[.-0]' Τ
ΰˤޥåʤΰϡۤ `/' ʸޤळȤϤ
ʤʸˡ顼Ȥʤ롣
`.' ǻϤޤѥ̾Ǥϡʸۤ˥ޥåʤФʤʤ (
ޤ `rm *' .profile ʤޤ `tar c *' ǤϤ٤ƤΥե
ϥ֤ʤ `tar c .' ɤ)
.SH Υꥹ
Ϳ狼䤹ñʥ롼롢֥磻ɥɥѥޥå
ѥ̾ΥꥹȤŸפȸΤϡꥸʥ Unix ˤ
ǤäϥѥΥꥹȤŸ뤳ȤĤƤ
㤨
.br
.nf
xv -wait 0 *.gif *.jpg
.fi
ˤơ *.gif ե뤬ʤǤ⡢϶ΥꥹȤŸ
뤿ᡢ顼ˤʤʤ
POSIX ǤϡʸˡŪʤѥ䡢ޥåʤäѥ
ϡΤޤѹ줺˻Ĥ뤳ȤˤʤäƤ롣
.I bash
Ǥ
.I allow_null_glob_expansion=true
ꤹ뤳Ȥǡοꤹ뤳ȤǤ롣
(Ʊ̤ͤΤȤǤⵯäƤ롣㤨СŤץȤˤ
.br
.nf
rm `find . -name "*~"`
.fi
Τ褦ʵҤϡץȤǤ
.br
.nf
rm -f nosuchfile `find . -name "*~"`
.fi
Τ褦ˤʤФʤʤʤ
.I rm
ꥹȤʤǸƤӽФǽꡢ顼åФƤޤ
Ǥ롣)
.SH
.SS ɽ
磻ɥɥѥɽ¿Ƥ뤬ξԤϰۤ
롣ޤˡԤե̾˥ޥåΤФơԤϥƥ
˥ޥå롣ˡ롼ƱǤϤʤ㤨ɽˤ `*'
ϡ֤줿ʸ 0 ʾη֤ɽ
ɽˤ֥饱åɽϤ뤬 `^' Ǥʤ롣 POSIX Ǥ
磻ɥɥѥˤ `[^...]' ̤ǤȤƤ롣
.SS ʸ饹ȹݲ
ΰϡȤȤϤ ASCII ˤ¤Ӥ̣Ƥ
ä `[\ \-%]' `[\ !"#$%]' ΰ̣Ǥꡢ `[a\-z]' ϡ֤٤Ƥξʸ
פΰ̣Ǥä Unix μˤϡĥΤ¸ߤ
Ǥ X\-Y Ȥΰϡ X Υɤ Y Υɤ˶ޤ줿
ɤʸ٤Ƥɽ褦ˤʤäƤˤϥ桼
ʥƥˤʸɤΤʤФʤ餺˥
ե٥åȤФȹ (collating sequence) ʸɤν
ȰۤʤäƤˤؤǤä
(: collating sequence ˴ؤƤ
.BR regex (7)
ȤƲ)
ä POSIX Ǥϡ磻ɥɥѥɽˤơ
֥饱åɽ˳ĥ롣ޤDz桹ϡ֥饱åɽˤ
ĤǤޤޤ줦뤳ȤƤʤ (i) ꡢ (ii) ñ
ʸ (iii) ΰꡢλĤǤ롣 POSIX Ǥϡΰݲ
ʤ褦ƤꡢޤĤΥפ֥饱åɽǤȤ
ɲäƤ롣
(iii) ΰ X\-Y X Y ˶ޤ줿 (ξüޤ) ٤Ƥʸ̣
롣ΤȤȥ (current locale) LC_COLLATE
ƥƤȹѤ롣
(iv) ̾դʸ饹: ʲΤ褦ʤΤǤ롣
.br
.nf
[:alnum:] [:alpha:] [:blank:] [:cntrl:]
[:digit:] [:graph:] [:lower:] [:print:]
[:punct:] [:space:] [:upper:] [:xdigit:]
.fi
Ѥ `[a-z]' `[[:lower:]]' Τ褦ʻ꤬Ǥ롣
ޤǥޡΤ褦ˡե٥åȤ `z' ʹߤ 3 Ĥʸ¸ߤ
褦ʾǤƱ褦ưԤǤ롣ʸ饹ϥ
ȥ LC_CTYPE ƥƤ롣
(v) ȹˤ륷ܥ: `[.ch.]' `[.a-acute.]' Τ褦 `[.'
`.]' Ƕޤ줿ʸϡȥ줿ȹ
Ȥʤ롣ĤǤʣʸʤ⤢ꤦ뤳Ȥա
(vi) 饹ɽ (equivalence class expressions): `[=a=]' Τ褦
`[=' `=]' ȤǶޤ줿ʸǤ롣
ΥСǤȹǤ٤Ƥˤʤ롣饹ϥȥ
ƤΤˤʤ롣㤨 `[[=a=]]'
[a\e`{a}\e'{a}\e"{a}\e^{a}] (: ܸ roff ڡǤ latin1
ɤФʤΤǡ TeX ѤɽƤޤ) Ʊ̣ˤ
롣ޤ `[a[.a\-acute.][.a\-grave.][.a\-umlaut.][.a\-circumflex.]]'
Ʊ̣ˤʤ롣
.SH Ϣ
.BR sh (1),
.BR glob (3),
.BR fnmatch (3),
.BR locale (7),
.BR regex (7)
|