OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / GNU_bash / work / P04
1 .\"O .SH EXPANSION
2 .SH Å¸³«
3 .\"O Expansion is performed on the command line after it has been split into
4 .\"O words.  There are seven kinds of expansion performed:
5 .\"O .IR "brace expansion" ,
6 .\"O .IR "tilde expansion" ,
7 .\"O .IR "parameter and variable expansion" ,
8 .\"O .IR "command substitution" ,
9 .\"O .IR "arithmetic expansion" ,
10 .\"O .IR "word splitting" ,
11 .\"O and
12 .\"O .IR "pathname expansion" .
13 Ÿ³«¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Ç¡¢Ã±¸ì¤Ø¤Îʬ³ä¤Î¸å¤Ë¹Ô¤ï¤ì¤Þ¤¹¡£¹Ô¤ï¤ì¤ëŸ³«¤Ï
14 7 ¼ïÎढ¤ê¤Þ¤¹:
15 .IR "¥Ö¥ì¡¼¥¹¤ÎŸ³« (brace expansion)" ,
16 .IR "¥Á¥ë¥À¤ÎŸ³« (tilde expansion)" ,
17 .IR "¥Ñ¥é¥á¡¼¥¿¤ÈÊÑ¿ô¤ÎŸ³« (parameter and variable expansion)" ,
18 .IR "¥³¥Þ¥ó¥ÉÃÖ´¹ (command substitution)" ,
19 .IR "»»½Ñ¼°Å¸³« (arithmetic expansion)" ,
20 .IR "ñ¸ì¤Îʬ³ä (word splitting)" ,
21 .IR "¥Ñ¥¹Ì¾¤ÎŸ³« (pathname expansion)" ¡£
22 .PP
23 .\"O The order of expansions is: brace expansion, tilde expansion,
24 .\"O parameter, variable and arithmetic expansion and
25 .\"O command substitution
26 .\"O (done in a left-to-right fashion), word splitting, and pathname
27 .\"O expansion.
28 Ÿ³«¤Î½ç½ø¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹: ¥Ö¥ì¡¼¥¹Å¸³«¡¢¥Á¥ë¥ÀŸ³«¡¢¥Ñ¥é¥á¡¼¥¿¡¦
29 ÊÑ¿ô¡¦»»½Ñ¼°Å¸³«¡¢¥³¥Þ¥ó¥ÉÃÖ´¹ (º¸¤«¤é±¦¤Ø)¡¢Ã±¸ìʬ³ä¡¢¥Ñ¥¹Ì¾Å¸³«¡£
30 .PP
31 .\"O On systems that can support it, there is an additional expansion
32 .\"O available: \fIprocess substitution\fP.
33 ¤³¤ì¤é¤Ë²Ã¤¨¤Æ \fI¥×¥í¥»¥¹ÃÖ´¹ (process substitution)\fP ¤ò¥µ¥Ý¡¼¥È¤Ç¤­
34 ¤ë¥·¥¹¥Æ¥à¤â¤¢¤ê¤Þ¤¹¡£
35 .PP
36 .\"O Only brace expansion, word splitting, and pathname expansion
37 .\"O can change the number of words of the expansion; other expansions
38 .\"O expand a single word to a single word.
39 .\"O The only exceptions to this are the expansions of
40 .\"O "\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP"
41 .\"O as explained above (see
42 .\"O .SM
43 .\"O .BR PARAMETERS ).
44 Ÿ³«¤·¤¿Éôʬ¤Îñ¸ì¤Î¿ô¤¬ÊѲ½¤¹¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ï¡¢¥Ö¥ì¡¼¥¹Å¸³«¡¢Ã±¸ì¤Î
45 ʬ³ä¡¢¥Ñ¥¹Ì¾Å¸³«¤À¤±¤Ç¤¹¡£Â¾¤ÎŸ³«¤Ç¤Ï¡¢1 ¤Ä¤Îñ¸ì¤Ï 1 ¤Ä¤Îñ¸ì¤ËŸ³«
46 ¤µ¤ì¤Þ¤¹¡£¤³¤Îµ¬Â§¤ÎÍ£°ì¤ÎÎã³°¤ÏÀè¤ËÀâÌÀ¤·¤¿
47  "\fB$@\fP" ¤È "\fB${\fP\fIname\fP\fB[@]}\fP" ¤ÎŸ³« (
48 .SM
49 .B ¥Ñ¥é¥á¡¼¥¿
50 ¤ò»²¾È) ¤À¤±¤Ç¤¹¡£
51 .\"O .SS Brace Expansion
52 .SS ¥Ö¥ì¡¼¥¹Å¸³«
53 .PP
54 .\"O .I "Brace expansion"
55 .\"O is a mechanism by which arbitrary strings
56 .\"O may be generated.  This mechanism is similar to
57 .\"O \fIpathname expansion\fP, but the filenames generated
58 .\"O need not exist.  Patterns to be brace expanded take
59 .\"O the form of an optional
60 .\"O .IR preamble ,
61 .\"O followed by a series of comma-separated strings
62 .\"O between a pair of braces, followed by an optional
63 .\"O .IR postscript .
64 .\"O The preamble is prefixed to each string contained
65 .\"O within the braces, and the postscript is then appended
66 .\"O to each resulting string, expanding left to right.
67 .I "¥Ö¥ì¡¼¥¹Å¸³« (brace expansion)"
68 ¤Ï¡¢Ç¤°Õ¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ëµ¡¹½¤Ç¤¹¡£¤³¤Îµ¡¹½¤Ï
69 \fI¥Ñ¥¹Ì¾Å¸³«\fP¤Ë»÷¤Æ¤¤¤Þ¤¹¤¬¡¢À¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬¼Âºß¤¹¤ëɬÍפϤ¢
70 ¤ê¤Þ¤»¤ó¡£Å¸³«¤µ¤ì¤ë¥Ö¥ì¡¼¥¹¤Ë¤Ê¤ë¥Ñ¥¿¡¼¥ó¤Ï¡¢
71 ¾Êά²Äǽ¤Ê
72 .IR "Á°ÃÖÉôʬ (preamble)" ¡¢
73 ÂФˤʤë¥Ö¥ì¡¼¥¹¤Î´Ö¤Ë¥³¥ó¥Þ¤Ç¶èÀڤäÆʤ٤¿Ê¸»úÎó¡¢
74 ¾Êά²Äǽ¤Ê
75 .I ¸åÃÖÉôʬ (postscript)
76 ¤ò½ç¤Ëʤ٤¿¤â¤Î¤Ç¤¹¡£Á°ÃÖÉôʬ¤Ï¥Ö¥ì¡¼¥¹Æâ¤Ë¤¢¤ëʸ»úÎ󤽤줾¤ì¤ÎÀèƬÉô
77 ʬ¤ËÄɲ䵤졢¸åÃÖÉôʬ¤Ïº¸¤«¤é±¦¤Ë½ç¤ËŸ³«¤µ¤ì¤ÆÆÀ¤é¤ì¤¿¤½¤ì¤¾¤ì¤Îʸ»úÎó
78 ¤ÎËöÈø¤ËÄɲ䵤ì¤Þ¤¹¡£
79 .PP
80 .\"O Brace expansions may be nested.  The results of each expanded
81 .\"O string are not sorted; left to right order is preserved.
82 .\"O For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'.
83 ¥Ö¥ì¡¼¥¹¤ÎŸ³«¤ÏÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Å¸³«¤·¤ÆÆÀ¤é¤ì¤¿Ê¸»úÎó¤Ï¥½¡¼
84 ¥È¤µ¤ì¤º¡¢º¸¤«¤é±¦¤Ø¤Î½çÈÖ¤¬¤½¤Î¤Þ¤Þ»Ä¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢
85 a\fB{\fPd,c,b\fB}\fPe ¤Ï `ade ace abe' ¤ÈŸ³«¤µ¤ì¤Þ¤¹¡£
86 .PP
87 .\"O Brace expansion is performed before any other expansions,
88 .\"O and any characters special to other expansions are preserved
89 .\"O in the result.  It is strictly textual.
90 .\"O .B Bash
91 .\"O does not apply any syntactic interpretation to the context of the
92 .\"O expansion or the text between the braces.
93 ¥Ö¥ì¡¼¥¹¤ÎŸ³«¤Ï¾¤Î¤É¤ÎŸ³«¤è¤ê¤âÁ°¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢Â¾¤ÎŸ³«¤Ë¤ª
94 ¤¤¤ÆÆüì¤Ê°ÕÌ£¤ò»ý¤Äʸ»ú¤â¤½¤Î¤Þ¤Þ·ë²Ì¤Ë»Ä¤ê¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢¸·Ì©¤Ë¥Æ¥­¥¹
95 ¥ÈÁàºî¤À¤±¤ò¹Ô¤¤¤Þ¤¹¡£
96 .B bash
97 ¤Ï¡¢Å¸³«¤Îʸ̮¤ä¥Ö¥ì¡¼¥¹¤Î´Ö¤Î¥Æ¥­¥¹¥È¤ËÂФ·¤ÆʸˡŪ¤Ê²ò¼á¤òŬÍѤ¹¤ë¤³
98 ¤È¤Ï°ìÀÚ¤¢¤ê¤Þ¤»¤ó¡£
99 .PP
100 .\"O A correctly-formed brace expansion must contain unquoted opening
101 .\"O and closing braces, and at least one unquoted comma.
102 .\"O Any incorrectly formed brace expansion is left unchanged.
103 .\"O A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its
104 .\"O being considered part of a brace expression.
105 Àµ¤·¤¤·Á¤Î¥Ö¥ì¡¼¥¹Å¸³«¤Ë¤Ï¡¢¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤³«¤­¥Ö¥ì¡¼¥¹¤ÈÊĤ¸¥Ö¥ì¡¼
106 ¥¹¡¢¤Þ¤¿¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥³¥ó¥Þ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì
107 ¤Ð¤Ê¤ê¤Þ¤»¤ó¡£Àµ¤·¤¤·Á¤Ç¤Ê¤¤¥Ö¥ì¡¼¥¹Å¸³«¤ÏÁ´¤Æ¡¢Êѹ¹¤µ¤ì¤Ê¤¤¤Ç¤½¤Î¤Þ¤Þ
108 »Ä¤ê¤Þ¤¹¡£\fB{\fP ¤ä \fB,\fP ¤ò¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç¥¯¥©¡¼¥È¤¹¤ì¤Ð¡¢¥Ö¥ì¡¼
109 ¥¹Å¸³«¤Î°ìÉô¤È²ò¼á¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
110 .\"O To avoid conflicts with parameter expansion, the string \fB${\fP
111 .\"O is not considered eligible for brace expansion.
112 ¥Ñ¥é¥á¡¼¥¿Å¸³«¤È¤Î¾×ÆͤòÈò¤±¤ë¤¿¤á¡¢Ê¸»úÎó \fB${\fP
113 ¤Ï¥Ö¥ì¡¼¥¹Å¸³«¤ÎÂоݤȤϲò¼á¤µ¤ì¤Þ¤»¤ó¡£
114 .PP
115 .\"O This construct is typically used as shorthand when the common
116 .\"O prefix of the strings to be generated is longer than in the
117 .\"O above example:
118 ¤³¤Î»ÅÁȤߤϡ¢À¸À®¤µ¤ì¤ëʸ»úÎó¤Î¶¦ÄÌÀèƬÉôʬ¤¬¡¢¾åµ­¤ÎÎã¤è¤êŤ¤¾ì¹ç
119 ¤Ë¡¢Ã»½Ìɽ¸½¤È¤·¤Æ¤è¤¯»ÈÍѤµ¤ì¤Þ¤¹:
120 .RS
121 .PP
122 mkdir /usr/local/src/bash/{old,new,dist,bugs}
123 .RE
124 .\"O or
125 ¤¢¤ë¤¤¤Ï
126 .RS
127 chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
128 .RE
129 .PP
130 .\"O Brace expansion introduces a slight incompatibility with
131 .\"O historical versions of
132 .\"O .BR sh .
133 .\"O .B sh
134 .\"O does not treat opening or closing braces specially when they
135 .\"O appear as part of a word, and preserves them in the output.
136 ¥Ö¥ì¡¼¥¹Å¸³«¤ÎƳÆþ¤Ë¤è¤Ã¤Æ¡¢ÅÁÅýŪ¤Ê
137 .B sh
138 ¤È¤Ï¾¯¤·Èó¸ß´¹¤Ë¤Ê¤Ã¤¿Éôʬ¤¬¤¢¤ê¤Þ¤¹¡£
139 .B sh
140 ¤Ïñ¸ì¤Î°ìÉô¤È¤·¤Æ³«¤­¥Ö¥ì¡¼¥¹¤äÊĤ¸¥Ö¥ì¡¼¥¹¤¬¸½¤ï¤ì¤Æ¤âÆÃÊÌ°·¤¤¤Ï¤»¤º¡¢
141 ¤½¤Î¤Þ¤Þ½ÐÎϤ˻Ĥ·¤Þ¤¹¡£
142 .\"O .B Bash
143 .\"O removes braces from words as a consequence of brace
144 .\"O expansion.  For example, a word entered to
145 .\"O .B sh
146 .\"O as \fIfile{1,2}\fP
147 .\"O appears identically in the output.  The same word is
148 .\"O output as
149 .\"O .I file1 file2
150 .\"O after expansion by
151 .\"O .BR bash .
152 .B bash
153 ¤Ï¥Ö¥ì¡¼¥¹Å¸³«¤Î·ë²Ì¤È¤·¤Æñ¸ì¤«¤é¥Ö¥ì¡¼¥¹¤ò¼è¤ê½ü¤­¤Þ¤¹¡£Î㤨¤Ð¡¢
154 .B sh
155 ¤Ë \fIfile{1,2}\fP ¤Î¤è¤¦¤ËÆþÎϤµ¤ì¤¿Ã±¸ì¤Ï¡¢¤½¤Î¤Þ¤Þ¤Î·Á¤Ç½ÐÎϤµ¤ì¤Þ
156 ¤¹¡£
157 .BR bash
158 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸Ã±¸ì¤ÏŸ³«¤µ¤ì¤Æ
159 .I file1 file2
160 ¤Î¤è¤¦¤Ë½ÐÎϤµ¤ì¤Þ¤¹¡£
161 .\"O If strict compatibility with
162 .\"O .B sh
163 .\"O is desired, start
164 .\"O .B bash
165 .\"O with the
166 .\"O .B +B 
167 .\"O option or disable brace expansion with the
168 .\"O .B +B
169 .\"O option to the
170 .\"O .B set
171 .\"O command (see
172 .\"O .SM
173 .\"O .B SHELL BUILTIN COMMANDS
174 .\"O below).
175 ¸·Ì©¤Ë
176 .B sh
177 ¤È¸ß´¹¤Ë¤·¤¿¤±¤ì¤Ð¡¢
178 .B bash
179 ¤ò
180 .B +B 
181 ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤Æµ¯Æ°¤¹¤ë¤«¡¢
182 .B set
183 ¥³¥Þ¥ó¥É¤Ë
184 .B +B
185 ¤ò»ØÄꤷ¤Æ¥Ö¥ì¡¼¥¹Å¸³«¤ò̵¸ú¤Ë¤·¤Æ¤¯¤À¤µ¤¤
186 (¸å½Ò¤¹¤ë
187 .SM
188 .B ¥·¥§¥ëÁȤ߹þ¤ß¥³¥Þ¥ó¥É
189 ¤ò»²¾È)¡£
190 .\"O .SS Tilde Expansion
191 .SS ¥Á¥ë¥ÀŸ³«
192 .PP
193 .\"O If a word begins with an unquoted tilde character (`\fB~\fP'), all of
194 .\"O the characters preceding the first unquoted slash (or all characters,
195 .\"O if there is no unquoted slash) are considered a \fItilde-prefix\fP.
196 ¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥Á¥ë¥À (`\fB~\fP') ¤Çñ¸ì¤¬»Ï¤Þ¤Ã¤¿¾ì¹ç¡¢¥¯¥©¡¼¥È¤µ
197 ¤ì¤Æ¤¤¤Ê¤¤¥¹¥é¥Ã¥·¥å¤è¤ê¤âÁ°¤Ë¤¢¤ëʸ»ú¤¹¤Ù¤Æ (¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥¹¥é¥Ã
198 ¥·¥å¤¬Ìµ¤±¤ì¤Ð¤¹¤Ù¤Æ¤Îʸ»ú) ¤Ï¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹ (\fItilde-prefix\fP) ¤È
199 ²ò¼á¤µ¤ì¤Þ¤¹¡£
200 .\"O If none of the characters in the tilde-prefix are quoted, the
201 .\"O characters in the tilde-prefix following the tilde are treated as a
202 .\"O possible \fIlogin name\fP.
203 .\"O If this login name is the null string, the tilde is replaced with the
204 .\"O value of the shell parameter
205 .\"O .SM
206 .\"O .BR HOME .
207 ¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤ëʸ»ú¤¬¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹Ãæ¤Ë̵¤±¤ì¤Ð¡¢
208 ¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹Ãæ¤Î¥Á¥ë¥À°Ê¹ß¤Îʸ»ú¤Ï¡¢\fI¥í¥°¥¤¥ó̾ (login
209 name)\fP ¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ëʸ»úÎó¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£¤³¤Î¥í¥°¥¤¥ó̾¤¬
210 ¶õʸ»úÎó¤Ê¤é¤Ð¡¢¥Á¥ë¥À¤Ï¥·¥§¥ë¥Ñ¥é¥á¡¼¥¿
211 .SM
212 .B HOME
213 ¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
214 .\"O If
215 .\"O .SM
216 .\"O .B HOME
217 .\"O is unset, the home directory of the user executing the shell is
218 .\"O substituted instead.
219 .\"O Otherwise, the tilde-prefix is replaced with the home directory
220 .\"O associated with the specified login name.
221 .SM
222 .B HOME
223 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢Âå¤ï¤ê¤Ë¥·¥§¥ë¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤Î¥Û¡¼
224 ¥à¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯
225 ¥¹¤Ï»ØÄꤵ¤ì¤¿¥í¥°¥¤¥ó̾¤ËÂбþ¤¹¤ë¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
226 .PP
227 .\"O If the tilde-prefix is a `~+', the value of the shell variable
228 .\"O .SM
229 .\"O .B PWD
230 .\"O replaces the tilde-prefix.
231 ¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤¬ `~+' ¤Ê¤é¤Ð¡¢¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ï¥·¥§¥ëÊÑ¿ô
232 .SM
233 .B PWD
234 ¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
235 .\"O If the tilde-prefix is a `~\-', the value of the shell variable
236 .\"O .SM
237 .\"O .BR OLDPWD ,
238 .\"O if it is set, is substituted.
239 ¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤¬ `~\-' ¤Ê¤é¤Ð¡¢¥·¥§¥ëÊÑ¿ô
240 .SM
241 .B OLDPWD
242 ¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹ (Ãͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð)¡£
243 .\"O If the characters following the tilde in the tilde-prefix consist
244 .\"O of a number \fIN\fP, optionally prefixed
245 .\"O by a `+' or a `\-', the tilde-prefix is replaced with the corresponding
246 .\"O element from the directory stack, as it would be displayed by the
247 .\"O .B dirs
248 .\"O builtin invoked with the tilde-prefix as an argument.
249 .\"O If the characters following the tilde in the tilde-prefix consist of a
250 .\"O number without a leading `+' or `\-', `+' is assumed.
251 ¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹Ãæ¤Î¥Á¥ë¥À¤è¤ê¸å¤Îʸ»ú¤¬¿ôÃÍ \fIN\fP ¤Ç¤¢¤ì¤Ð (
252 ¿ôÃͤÎÁ°¤Ë `+' ¤ä `\-' ¤òÃÖ¤¯¤³¤È¤â¤Ç¤­¤Þ¤¹)¡¢¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ï¥Ç¥£
253 ¥ì¥¯¥È¥ê¥¹¥¿¥Ã¥¯Æâ¤ÎÂбþ¤¹¤ëÍ×ÁǤËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
254 ÃÖ´¹¤µ¤ì¤ëÍ×ÁǤϡ¢¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤ò°ú¤­¿ô¤È¤·¤ÆÁȤ߹þ¤ß¥³¥Þ¥ó¥É
255 .B dirs
256 ¤ò¼Â¹Ô¤·¤¿¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¤â¤Î¤Ç¤¹¡£
257 ¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ë¤ª¤±¤ë¥Á¥ë¥À°Ê¹ß¤Îʸ»ú¤¬¡¢Àè¹Ô¤¹¤ë `+' ¤ä `-' ¤Î¤Ê¤¤
258 ¿ôÃͤǤ¢¤ë¾ì¹ç¤Ï¡¢`+' ¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£
259 .PP
260 .\"O If the login name is invalid, or the tilde expansion fails, the word
261 .\"O is unchanged.
262 ¥í¥°¥¤¥ó̾¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¤ä¡¢¥Á¥ë¥ÀŸ³«¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢Ã±¸ì¤ÏÃÖ¤­
263 ´¹¤¨¤é¤ì¤Þ¤»¤ó¡£
264 .PP
265 .\"O Each variable assignment is checked for unquoted tilde-prefixes immediately
266 .\"O following a
267 .\"O .B :
268 .\"O or
269 .\"O .BR = .
270 .\"O In these cases, tilde expansion is also performed.
271 Á´¤Æ¤ÎÊÑ¿ôÂåÆþ¤Ë¤ª¤¤¤Æ
272 .B :
273 ¤ä
274 .B =
275 ¤Îľ¸å¤Ë¤¢¤ë¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥Á¥ë¥À¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì
276 ¤Þ¤¹¡£¤â¤·¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤â¥Á¥ë¥ÀŸ³«¤µ¤ì¤Þ¤¹¡£
277 .\"O Consequently, one may use file names with tildes in assignments to
278 .\"O .SM
279 .\"O .BR PATH ,
280 .\"O .SM
281 .\"O .BR MAILPATH ,
282 .\"O and
283 .\"O .SM
284 .\"O .BR CDPATH ,
285 .\"O and the shell assigns the expanded value.
286 ¤·¤¿¤¬¤Ã¤Æ¡¢
287 .SM
288 .BR PATH ,
289 .SM
290 .BR MAILPATH ,
291 .SM
292 .BR CDPATH
293 ¤Ø¤ÎÂåÆþ¤Ë¥Á¥ë¥À¤ò´Þ¤à¥Õ¥¡¥¤¥ë̾¤ò»È¤¤¡¢Å¸³«¤µ¤ì¤¿Ãͤò¥·¥§¥ë¤ËÂåÆþ¤µ¤»
294 ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
295 .\"O .SS Parameter Expansion
296 .SS ¥Ñ¥é¥á¡¼¥¿¤ÎŸ³«
297 .PP
298 .\"O The `\fB$\fP' character introduces parameter expansion,
299 .\"O command substitution, or arithmetic expansion.  The parameter name
300 .\"O or symbol to be expanded may be enclosed in braces, which
301 .\"O are optional but serve to protect the variable to be expanded from
302 .\"O characters immediately following it which could be
303 .\"O interpreted as part of the name.
304 `\fB$\fP' Ê¸»ú¤¬¤¢¤ë¤È¡¢¥Ñ¥é¥á¡¼¥¿Å¸³«¡¢¥³¥Þ¥ó¥ÉÃÖ´¹¡¢»»½Ñ¼°Å¸³«¤¬¹Ô¤ï
305 ¤ì¤Þ¤¹¡£Å¸³«¤µ¤ì¤ë¥Ñ¥é¥á¡¼¥¿Ì¾¤ä¥·¥ó¥Ü¥ë¤Ï¡¢¥Ö¥ì¡¼¥¹¤Ç³ç¤ë¤³¤È¤â¤Ç¤­¤Þ
306 ¤¹¡£¥Ö¥ì¡¼¥¹¤Ï¾Êά²Äǽ¤Ç¤¹¤¬¡¢ÊÑ¿ô¤Îľ¸å¤Ë¤¢¤ê¡¢¤½¤Î̾Á°¤Î°ìÉô¤È²ò¼á¤¹
307 ¤ë¤³¤È¤¬¤Ç¤­¤ëʸ»ú¤È°ì½ï¤ËÊÑ¿ô¤¬Å¸³«¤µ¤ì¤ë¤³¤È¤òËɤ°ÊýË¡¤È¤·¤ÆÍÑ°Õ¤µ¤ì
308 ¤Æ¤¤¤Þ¤¹¡£
309 .PP
310 .\"O When braces are used, the matching ending brace is the first `\fB}\fP'
311 .\"O not escaped by a backslash or within a quoted string, and not within an
312 .\"O embedded arithmetic expansion, command substitution, or paramter
313 .\"O expansion.
314 ¥Ö¥ì¡¼¥¹¤ò»È¤Ã¤¿¾ì¹ç¡¢¥Þ¥Ã¥Á¥ó¥°¤ò½ª¤¨¤ë¥Ö¥ì¡¼¥¹¤ÏºÇ½é¤Î `\fB}\fP' ¤Ç
315 ¤¹¡£¤¿¤À¤·¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç¥¨¥¹¥±¡¼¥×¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ä¥¯¥©¡¼¥È¤µ¤ì¤Æ
316 ¤¤¤ëʸ»úÎóÃæ¤Î¤â¤Î¤Ï´Þ¤Þ¤ì¤Þ¤»¤ó¤·¡¢»»½Ñ¼°Å¸³«¤ä¥³¥Þ¥ó¥ÉÃÖ´¹¡¢¥Ñ¥é¥á¡¼
317 ¥¿Å¸³«¤ËÆþ¤Ã¤Æ¤¤¤ë¤â¤Î¤â´Þ¤Þ¤ì¤Þ¤»¤ó¡£
318 .PP
319 .PD 0
320 .TP
321 ${\fIparameter\fP}
322 .\"O The value of \fIparameter\fP is substituted.  The braces are required
323 .\"O when
324 .\"O .I parameter
325 .\"O is a positional parameter with more than one digit,
326 .\"O or when
327 .\"O .I parameter
328 .\"O is followed by a character which is not to be
329 .\"O interpreted as part of its name.
330 \fIparameter\fP ¤ÎÃͤ¬ÃÖ´¹¤µ¤ì¤Þ¤¹¡£¥Ö¥ì¡¼¥¹¤¬É¬Íפˤʤë¤Î¤Ï¡¢
331 .I parameter
332 ¤¬ 2 ·å°Ê¾å¤Î¿ô»ú¤ò»ý¤Ä°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Î¾ì¹ç¤ä¡¢
333 .I parameter
334 ¤Îľ¸å¤Îʸ»ú¤ò̾Á°¤Î°ìÉô¤È¤·¤Æ²ò¼á¤µ¤»¤¿¤¯¤Ê¤¤¾ì¹ç¤Ç¤¹¡£
335 .PD
336 .PP
337 .\"O If the first character of \fIparameter\fP is an exclamation point,
338 .\"O a level of variable indirection is introduced.
339 .\"O \fBBash\fP uses the value of the variable formed from the rest of
340 .\"O \fIparameter\fP as the name of the variable; this variable is then
341 .\"O expanded and that value is used in the rest of the substitution, rather
342 .\"O than the value of \fIparameter\fP itself.
343 .\"O This is known as \fIindirect expansion\fP.
344 \fIparameter\fP ¤ÎºÇ½é¤Îʸ»ú¤¬´¶Ã²Éä¤Ç¤¢¤ë¾ì¹ç¡¢´ÖÀÜÊÑ¿ô¥ì¥Ù¥ë
345 (level of variable indirection) ¤È¤¤¤¦³µÇ°¤¬Æ³Æþ¤µ¤ì¤Þ¤¹¡£\fBbash\fP ¤Ï¡¢
346 Ÿ³«¤Ë \fIparameter\fP  ¤½¤Î¤â¤Î¤ÎÃͤò»ÈÍѤ¹¤ë¤Î¤Ç¤Ê¤¯¡¢
347 \fIparameter\fP ¤Î´¶Ã²Éä¤ò½ü¤¤¤¿»Ä¤ê¤Îʸ»ú¤òÊÑ¿ô̾¤È¤·¤Æ°·¤¤¡¢¤½¤ÎÊÑ¿ô
348 ¤ÎÃͤò¤½¤Î¸åŸ³«¤Ë»ÈÍѤ·¤Þ¤¹¡£¤³¤ì¤¬\fI´ÖÀÜŸ³« (indirect expansion)\fP
349 ¤È¸Æ¤Ð¤ì¤ë¤â¤Î¤Ç¤¹¡£
350 .\"O The exception to this is the expansion of ${!\fIprefix\fP*}
351 .\"O described below.
352 ¤¿¤À¤·Îã³°¤È¤·¤Æ¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë ${!\fIprefix\fP*} ¤ÎŸ³«¤¬¤¢¤ê¤Þ¤¹¡£
353 .PP
354 .\"O In each of the cases below, \fIword\fP is subject to tilde expansion,
355 .\"O parameter expansion, command substitution, and arithmetic expansion.
356 .\"O When not performing substring expansion, \fBbash\fP tests for a parameter
357 .\"O that is unset or null; omitting the colon results in a test only for a
358 .\"O parameter that is unset.
359 °Ê²¼¤Ë¼¨¤¹¤½¤ì¤¾¤ì¤Î¾ì¹ç¡¢\fIword\fP ¤ËÂФ·¤Æ¥Á¥ë¥ÀŸ³«¡¢¥Ñ¥é¥á¡¼¥¿Å¸
360 ³«¡¢¥³¥Þ¥ó¥ÉÃÖ´¹¡¢»»½Ñ¼°Å¸³«¤¬¹Ô¤ï¤ì¤Þ¤¹¡£Éôʬʸ»úÎ󟳫°Ê³°¤Î¾ì¹ç¡¢ 
361 \fBbash\fP ¤Ï¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¡¢¶õ¤Ç¤Ï¤Ê¤¤¤«¤òÄ´¤Ù¤Þ¤¹¡£¥³
362 ¥í¥ó¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤ÏÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¤ß¤òÄ´¤Ù¤Þ¤¹¡£
363 .PP
364 .PD 0
365 .TP
366 ${\fIparameter\fP\fB:\-\fP\fIword\fP}
367 .\"O \fBUse Default Values\fP.  If
368 .\"O .I parameter
369 .\"O is unset or null, the expansion of
370 .\"O .I word
371 .\"O is substituted.  Otherwise, the value of
372 .\"O .I parameter
373 .\"O is substituted.
374 \fB¥Ç¥Õ¥©¥ë¥È¤ÎÃͤò»È¤¤¤Þ¤¹\fP¡£
375 .I parameter
376 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¶õʸ»úÎó¤Ç¤¢¤ì¤Ð¡¢
377 .I word
378 ¤òŸ³«¤·¤¿¤â¤Î¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢
379 .I parameter
380 ¤ÎÃͤËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
381 .TP
382 ${\fIparameter\fP\fB:=\fP\fIword\fP}
383 .\"O \fBAssign Default Values\fP.
384 \fB¥Ç¥Õ¥©¥ë¥ÈÃͤòÂåÆþ¤·¤Þ¤¹\fP¡£
385 .\"O If
386 .\"O .I parameter
387 .\"O is unset or null, the expansion of
388 .\"O .I word
389 .\"O is assigned to
390 .\"O .IR parameter .
391 .\"O The value of
392 .\"O .I parameter
393 .\"O is then substituted.  Positional parameters and special parameters may
394 .\"O not be assigned to in this way.
395 .I parameter
396 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¶õʸ»úÎó¤Ç¤¢¤ì¤Ð¡¢
397 .I word
398 ¤òŸ³«¤·¤¿¤â¤Î¤¬
399 .I parameter
400 ¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡£¤½¤ì¤«¤é
401 .I parameter
402 ¤ÎÃͤؤÎÃÖ´¹¤¬¹Ô¤ï¤ì¤Þ¤¹¡£°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤äÆüì¥Ñ¥é¥á¡¼¥¿¤Ø¤ÎÂå
403 Æþ¤ò¤³¤Î¤è¤¦¤Ë¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
404 .TP
405 ${\fIparameter\fP\fB:?\fP\fIword\fP}
406 .\"O \fBDisplay Error if Null or Unset\fP.
407 \fB¶õʸ»úÎó¤Þ¤¿¤ÏÀßÄꤵ¤ì¤Æ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¥¨¥é¡¼¤òɽ¼¨¤·¤Þ¤¹\fP¡£
408 .\"O If
409 .\"O .I parameter
410 .\"O is null or unset, the expansion of \fIword\fP (or a message to that effect
411 .\"O if
412 .\"O .I word
413 .\"O is not present) is written to the standard error and the shell, if it
414 .\"O is not interactive, exits.  Otherwise, the value of \fIparameter\fP is
415 .\"O substituted.
416 .I parameter
417 ¤¬¶õʸ»úÎó¤Þ¤¿¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\fIword\fP ¤òŸ³«¤·¤¿¤â¤Î (
418 .I word
419 ¤¬¤Ê¤±¤ì¤Ð¡¢¥Ñ¥é¥á¡¼¥¿¤¬¶õʸ»úÎó¤Þ¤¿¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¥á¥Ã¥»¡¼
420 ¥¸) ¤¬É¸½à¥¨¥é¡¼½ÐÎϤ˽ÐÎϤµ¤ì¤Þ¤¹¡£¥·¥§¥ë¤¬ÂÐÏÃŪ¤Ç¤Ê¤±¤ì¤Ð¡¢¥·¥§¥ë¤Ï
421 ½ªÎ»¤·¤Þ¤¹¡£¥Ñ¥é¥á¡¼¥¿¤Ë¶õʸ»úÎó°Ê³°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢
422 \fIparameter\fP ¤ÎÃͤؤÎÃÖ´¹¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
423 .TP
424 ${\fIparameter\fP\fB:+\fP\fIword\fP}
425 .\"O \fBUse Alternate Value\fP.
426 \fBÊ̤ÎÃͤò»ÈÍѤ·¤Þ¤¹\fP¡£
427 .\"O If
428 .\"O .I parameter
429 .\"O is null or unset, nothing is substituted, otherwise the expansion of
430 .\"O .I word
431 .\"O is substituted.
432 .I parameter
433 ¤¬¶õʸ»úÎó¤Þ¤¿¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¶õʸ»úÎó¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£¤½¤¦¤Ç¤Ê
434 ¤±¤ì¤Ð¡¢
435 .I word
436 ¤òŸ³«¤·¤¿¤â¤Î¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
437 .TP
438 .PD 0
439 ${\fIparameter\fP\fB:\fP\fIoffset\fP}
440 .TP
441 ${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP}
442 .PD
443 .\"O \fBSubstring Expansion.\fP
444 \fBÉôʬʸ»úÎ󟳫\fP¡£
445 .\"O Expands to up to \fIlength\fP characters of \fIparameter\fP
446 .\"O starting at the character specified by \fIoffset\fP.
447 .\"O If \fIlength\fP is omitted, expands to the substring of
448 .\"O \fIparameter\fP, starting at the character specified by \fIoffset\fP.
449 .\"O \fIlength\fP and \fIoffset\fP are arithmetic expressions (see
450 .\"O .SM
451 .\"O .B
452 .\"O ARITHMETIC EVALUATION
453 .\"O below).
454 \fIparameter\fP ¤òŸ³«¤·¤¿¤â¤Î¤«¤éºÇÂç \fIlength\fP Ê¸»ú¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
455 ÀèƬ¤Îʸ»ú¤Ï \fIoffset\fP ¤Ç»ØÄꤷ¤Þ¤¹¡£\fIlength\fP ¤ò¾Êά¤¹¤ë¤È¡¢
456 \fIoffset\fP ¤Ç»ØÄꤷ¤¿Ê¸»ú¤òÀèƬ¤Ë¤·¤Æ¡¢\fIparameter\fP ¤Î»Ä¤êÁ´Éô¤¬
457 ´Þ¤Þ¤ì¤ëÉôʬʸ»úÎó¤ËŸ³«¤·¤Þ¤¹¡£\fIlength\fP ¤È \fIoffset\fP ¤Ï»»½Ñ¼°
458 ¤Ç¤¹ (¸å½Ò¤Î
459 .SM
460 .B »»½Ñ¼°É¾²Á
461 ¤ò»²¾È)¡£
462 .\"O \fIlength\fP must evaluate to a number greater than or equal to zero.
463 .\"O If \fIoffset\fP evaluates to a number less than zero, the value
464 .\"O is used as an offset from the end of the value of \fIparameter\fP.
465 \fIlength\fP ¤Îɾ²Á·ë²Ì¤Ï 0 °Ê¾å¤Î¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
466 \fIoffset\fP ¤òɾ²Á¤¹¤ë¤È 0 Ì¤Ëþ¤Î¿ô¤Ë¤Ê¤ë¾ì¹ç¡¢¤³¤ÎÃͤÏ
467 \fIparameter\fP ¤ÎÃͤÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤È¤·¤Æ»È¤ï¤ì¤Þ¤¹¡£
468 .\"O If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional
469 .\"O parameters beginning at \fIoffset\fP.
470 .\"O If \fIparameter\fP is an array name indexed by @ or *,
471 .\"O the result is the \fIlength\fP
472 .\"O members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}.
473 .\"O Substring indexing is zero-based unless the positional parameters 
474 .\"O are used, in which case the indexing starts at 1.
475 \fIparameter\fP ¤¬ \fB@\fP ¤Ê¤é¤Ð¡¢·ë²Ì¤Ï \fIoffset\fP ¤«¤é»Ï¤Þ¤ë
476 \fIlength\fP ¸Ä¤Î°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Ë¤Ê¤ê¤Þ¤¹¡£
477 \fIparameter\fP ¤¬ @ ¤Þ¤¿¤Ï * ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ÉÕ¤¤¤Æ¤¤¤ëÇÛÎó̾¤Ê¤é¤Ð¡¢
478 ·ë²Ì¤ÏÇÛÎó¤Î ${\fIparameter\fP[\fIoffset\fP]} ¤òÀèƬ¤È¤¹¤ëÍ×ÁÇ
479 \fIlength\fP ¸Ä¤È¤Ê¤ê¤Þ¤¹¡£°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤ò»È¤¦¾ì¹ç°Ê³°¤Ï¡¢Éôʬʸ
480 »úÎó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï 0 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Î¾ì¹ç¤Ë¤Ï¡¢
481 ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï 1 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£
482 .TP
483 ${\fB!\fP\fIprefix\fP\fB*\fP}
484 .\"O Expands to the names of variables whose names begin with \fIprefix\fP,
485 .\"O separated by the first character of the
486 .\"O .SM
487 .\"O .B IFS
488 .\"O special variable.
489 \fIprefix\fP ¤Ç»Ï¤Þ¤ë¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤Î̾Á°¤ËŸ³«¤·¤Æ¡¢
490 .SM
491 .B IFS
492 ÆüìÊÑ¿ô¤ÎºÇ½é¤Îʸ»ú¤Ë¤è¤Ã¤Æ¶èÀÚ¤ê¤Þ¤¹¡£
493 .TP
494 ${\fB#\fP\fIparameter\fP}
495 .\"O The length in characters of the value of \fIparameter\fP is substituted.
496 .\"O If
497 .\"O .I parameter
498 .\"O is
499 .\"O .B *
500 .\"O or 
501 .\"O .BR @ ,
502 .\"O the value substituted is the number of positional parameters.
503 .\"O If
504 .\"O .I parameter
505 .\"O is an array name subscripted by
506 .\"O .B *
507 .\"O or
508 .\"O .BR @ ,
509 .\"O the value substituted is the number of elements in the array.
510 \fIparameter\fP ¤ÎÃͤ˴ޤޤì¤ëʸ»ú¿ô¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
511 .I parameter
512 ¤¬
513 .B *
514 ¤Þ¤¿¤Ï
515 .B @
516 ¤Ê¤é¤Ð¡¢°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Î¿ô¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
517 .I parameter
518 ¤¬
519 .B *
520 ¤Þ¤¿¤Ï
521 .B @
522 ¤¬Åº»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÇÛÎó̾¤Ê¤é¤Ð¡¢ÇÛÎóÃæ¤ÎÍ×ÁÇ¿ô¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
523 .TP
524 .PD 0
525 ${\fIparameter\fP\fB#\fP\fIword\fP}
526 .TP
527 ${\fIparameter\fP\fB##\fP\fIword\fP}
528 .PD
529 .\"O The 
530 .\"O .I word
531 .\"O is expanded to produce a pattern just as in pathname
532 .\"O expansion.  If the pattern matches the beginning of
533 .\"O the value of
534 .\"O .IR parameter ,
535 .\"O then the result of the expansion is the expanded value of
536 .\"O .I parameter
537 .\"O with the shortest matching pattern (the ``\fB#\fP'' case) or the
538 .\"O longest matching pattern (the ``\fB##\fP'' case) deleted.
539 .I word
540 ¤¬Å¸³«¤µ¤ì¡¢¥Ñ¥¹Ì¾Å¸³«¤Î¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ê¥Ñ¥¿¡¼¥ó¤òºî¤ê¤Þ¤¹¡£¤³
541 ¤Î¥Ñ¥¿¡¼¥ó¤¬
542 .I parameter
543 ¤ÎÃͤÎÀèƬÉôʬ¤È¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¡¢Å¸³«¤·¤ÆÆÀ¤é¤ì¤ëÃͤÏ
544 .I parameter
545 ¤òŸ³«¤·¤¿Ãͤ«¤éºÇû°ìÃץѥ¿¡¼¥ó (``\fB#\fP''¤Î¾ì¹ç) ¤Þ¤¿¤ÏºÇĹ°ìÃץѥ¿¡¼
546 ¥ó (``\fB##\fP'' ¤Î¾ì¹ç) ¤ò¼è¤ê½ü¤¤¤¿¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£
547 .\"O If
548 .\"O .I parameter
549 .\"O is
550 .\"O .B @
551 .\"O or
552 .\"O .BR * ,
553 .\"O the pattern removal operation is applied to each positional
554 .\"O parameter in turn, and the expansion is the resultant list.
555 .I parameter
556 ¤¬
557 .B @
558 ¤Þ¤¿¤Ï
559 .BR *
560 ¤Ç¤¢¤ë¾ì¹ç¡¢¥Ñ¥¿¡¼¥ó¤òºï½ü¤¹¤ëÁàºî¤ÏÁ´¤Æ¤Î°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Ë½çÈÖ¤ËŬ
561 ÍѤµ¤ì¡¢Å¸³«·ë²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
562 .\"O If
563 .\"O .I parameter
564 .\"O is an array variable subscripted with
565 .\"O .B @
566 .\"O or
567 .\"O .BR * ,
568 .\"O the pattern removal operation is applied to each member of the
569 .\"O array in turn, and the expansion is the resultant list.
570 .I parameter
571 ¤¬
572 .B @
573 ¤Þ¤¿¤Ï
574 .B *
575 ¤¬Åº»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÇÛÎóÊÑ¿ô¤Ç¤¢¤ë¾ì¹ç¡¢¥Ñ¥¿¡¼¥ó¤òºï½ü¤¹¤ëÁàºî¤ÏÇÛÎó¤ÎÁ´
576 ¤Æ¤ÎÍ×ÁǤ˽çÈÖ¤ËŬÍѤµ¤ì¡¢Å¸³«·ë²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
577 .TP
578 .PD 0
579 ${\fIparameter\fP\fB%\fP\fIword\fP}
580 .TP
581 ${\fIparameter\fP\fB%%\fP\fIword\fP}
582 .PD
583 .\"O The \fIword\fP is expanded to produce a pattern just as in
584 .\"O pathname expansion.
585 .\"O If the pattern matches a trailing portion of the expanded value of
586 .\"O .IR parameter ,
587 .\"O then the result of the expansion is the expanded value of
588 .\"O .I parameter
589 .\"O with the shortest matching pattern (the ``\fB%\fP'' case) or the
590 .\"O longest matching pattern (the ``\fB%%\fP'' case) deleted.
591 .I word
592 ¤¬Å¸³«¤µ¤ì¡¢¥Ñ¥¹Ì¾Å¸³«¤Î¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ê¥Ñ¥¿¡¼¥ó¤òºî¤ê¤Þ¤¹¡£¤³
593 ¤Î¥Ñ¥¿¡¼¥ó¤¬
594 .I parameter
595 ¤òŸ³«¤·¤¿ÃͤÎËöÈø¤ÎÉôʬ¤È¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¡¢Å¸³«·ë²Ì¤Ï
596 .I parameter
597 ¤òŸ³«¤·¤¿Ãͤ«¤éºÇû°ìÃץѥ¿¡¼¥ó (``\fB%\fP'' ¤Î¾ì¹ç) ¤Þ¤¿¤ÏºÇĹ°ìÃץѥ¿¡¼
598 ¥ó (``\fB%%\fP'' ¤Î¾ì¹ç) ¤ò¼è¤ê½ü¤¤¤¿¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£
599 .\"O If
600 .\"O .I parameter
601 .\"O is
602 .\"O .B @
603 .\"O or
604 .\"O .BR * ,
605 .\"O the pattern removal operation is applied to each positional
606 .\"O parameter in turn, and the expansion is the resultant list.
607 .I parameter
608 ¤¬
609 .B @
610 ¤Þ¤¿¤Ï
611 .B *
612 ¤Ç¤¢¤ë¾ì¹ç¡¢¥Ñ¥¿¡¼¥ó¤òºï½ü¤¹¤ëÁàºî¤ÏÁ´¤Æ¤Î°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Ë½çÈÖ¤ËŬ
613 ÍѤµ¤ì¡¢Å¸³«·ë²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
614 .\"O If
615 .\"O .I parameter
616 .\"O is an array variable subscripted with
617 .\"O .B @
618 .\"O or
619 .\"O .BR * ,
620 .\"O the pattern removal operation is applied to each member of the
621 .\"O array in turn, and the expansion is the resultant list.
622 .I parameter
623 ¤¬
624 .B @
625 ¤Þ¤¿¤Ï
626 .B *
627 ¤¬Åº»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÇÛÎóÊÑ¿ô¤Ç¤¢¤ë¾ì¹ç¡¢¥Ñ¥¿¡¼¥ó¤òºï½ü¤¹¤ëÁàºî¤ÏÇÛÎó¤ÎÁ´
628 ¤Æ¤ÎÍ×ÁǤ˽çÈÖ¤ËŬÍѤµ¤ì¡¢Å¸³«·ë²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
629 .TP
630 .PD 0
631 ${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP}
632 .TP
633 ${\fIparameter\fP\fB//\fP\fIpattern\fP\fB/\fP\fIstring\fP}
634 .PD
635 .\"O The \fIpattern\fP is expanded to produce a pattern just as in
636 .\"O pathname expansion.
637 \fIpattern\fP ¤¬Å¸³«¤µ¤ì¡¢¥Ñ¥¹Ì¾Å¸³«¤Î¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ê¥Ñ¥¿¡¼¥ó
638 ¤òºî¤ê¤Þ¤¹¡£
639 .\"O \fIParameter\fP is expanded and the longest match of \fIpattern\fP
640 .\"O against its value is replaced with \fIstring\fP.
641 \fIparameter\fP ¤ÎŸ³«¤¬¹Ô¤ï¤ì¡¢¤½¤ÎÃͤΤ¦¤Á \fIpattern\fP ¤ËºÇĹ°ìÃ×
642 ¤¹¤ëÉôʬ¤¬ \fIstring\fP ¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
643 .\"O In the first form, only the first match is replaced.
644 Á°¼Ô¤Î·Á¼°¤Î¾ì¹ç¤Ë¤Ï¡¢ºÇ½é¤Ë¥Þ¥Ã¥Á¤·¤¿Éôʬ¤À¤±¤¬ÃÖ´¹¤µ¤ì¤Þ¤¹¡£
645 .\"O The second form causes all matches of \fIpattern\fP to be
646 .\"O replaced with \fIstring\fP.
647 ¸å¼Ô¤Î·Á¼°¤Î¾ì¹ç¤Ë¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿Éôʬ¤ÏÁ´¤Æ \fIstring\fP ¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
648 .\"O If \fIpattern\fP begins with \fB#\fP, it must match at the beginning
649 .\"O of the expanded value of \fIparameter\fP.
650 \fIpattern\fP ¤¬ \fB#\fP ¤Ç»Ï¤Þ¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥¿¡¼¥ó¤Ï \fIparameter\fP 
651 ¤òŸ³«¤·¤¿ÃͤÎÀèƬ¤Ë¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
652 .\"O If \fIpattern\fP begins with \fB%\fP, it must match at the end
653 .\"O of the expanded value of \fIparameter\fP.
654 \fIpattern\fP ¤¬ \fB%\fP ¤Ç»Ï¤Þ¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥¿¡¼¥ó¤Ï \fIparameter\fP 
655 ¤òŸ³«¤·¤¿ÃͤÎËöÈø¤Ë¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
656 .\"O If \fIstring\fP is null, matches of \fIpattern\fP are deleted
657 .\"O and the \fB/\fP following \fIpattern\fP may be omitted.
658 \fIstring\fP ¤¬¶õ¤Î¾ì¹ç¤Ë¤Ï \fIpattern\fP ¤Ë¥Þ¥Ã¥Á¤·¤¿Éôʬ¤Ïºï½ü¤µ¤ì¤Þ
659 ¤¹¡£¤Þ¤¿¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fIpattern\fP ¤Î¸å¤Ë³¤¯ \fB/\fP ¤Ï¾Êά²Äǽ¤Ç¤¹¡£
660 .\"O If
661 .\"O .I parameter
662 .\"O is
663 .\"O .B @
664 .\"O or
665 .\"O .BR * ,
666 .\"O the substitution operation is applied to each positional
667 .\"O parameter in turn, and the expansion is the resultant list.
668 .I parameter
669 ¤¬
670 .B @
671 ¤Þ¤¿¤Ï
672 .B *
673 ¤Ç¤¢¤ë¾ì¹ç¡¢ÃÖ´¹Áàºî¤ÏÁ´¤Æ¤Î°ÌÃÖÉÕ¤­¥Ñ¥é¥á¡¼¥¿¤Ë½çÈÖ¤ËŬÍѤµ¤ì¡¢Å¸³«·ë
674 ²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
675 .\"O If
676 .\"O .I parameter
677 .\"O is an array variable subscripted with
678 .\"O .B @
679 .\"O or
680 .\"O .BR * ,
681 .\"O the substitution operation is applied to each member of the
682 .\"O array in turn, and the expansion is the resultant list.
683 .I parameter
684 ¤¬
685 .B @
686 ¤Þ¤¿¤Ï
687 .B *
688 ¤¬Åº»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÇÛÎóÊÑ¿ô¤Ç¤¢¤ë¾ì¹ç¡¢ÃÖ´¹Áàºî¤ÏÇÛÎó¤ÎÁ´¤Æ¤ÎÍ×ÁǤ˽çÈÖ
689 ¤ËŬÍѤµ¤ì¡¢Å¸³«·ë²Ì¤Ï¥ê¥¹¥È¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
690 .\"O .SS Command Substitution
691 .SS ¥³¥Þ¥ó¥ÉÃÖ´¹
692 .PP
693 .\"O \fICommand substitution\fP allows the output of a command to replace
694 .\"O the command name.  There are two forms:
695 \fI¥³¥Þ¥ó¥ÉÃÖ´¹ (command substitution)\fP ¤òÍѤ¤¤ë¤È¡¢¥³¥Þ¥ó¥É̾¤ò¥³¥Þ¥ó
696 ¥É¤Î½ÐÎϤÇÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥³¥Þ¥ó¥ÉÃÖ´¹¤Ë¤Ï°Ê²¼¤Î 2 ¤Ä¤Î·Á¼°
697 ¤¬¤¢¤ê¤Þ¤¹:
698 .PP
699 .RS
700 .PP
701 \fB$(\fP\fIcommand\fP\|\fB)\fP
702 .RE
703 .\"O or
704 ¤Þ¤¿¤Ï
705 .RS
706 \fB`\fP\fIcommand\fP\fB`\fP
707 .RE
708 .PP
709 .\"O .B Bash
710 .\"O performs the expansion by executing \fIcommand\fP and
711 .\"O replacing the command substitution with the standard output of the
712 .\"O command, with any trailing newlines deleted.
713 .\"O Embedded newlines are not deleted, but they may be removed during
714 .\"O word splitting.
715 .\"O The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by
716 .\"O the equivalent but faster \fB$(< \fIfile\fP)\fR.
717 .B bash
718 ¤Ë¤è¤ëŸ³«¤Ï¡¢\fIcommand\fP ¤Î¼Â¹Ô¤ª¤è¤Ó¥³¥Þ¥ó¥ÉÃÖ´¹¤ÎÉôʬ¤ò¥³¥Þ¥ó¥É¤Î
719 ɸ½à½ÐÎϤÈÃÖ´¹¤¹¤ë¤³¤È¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤³¤ÎºÝ¡¢ËöÈø¤Î²þ¹Ôʸ»ú¤Ïºï½ü
720 ¤µ¤ì¤Þ¤¹¡£Ê¸»úÎó¤ÎÅÓÃæ¤Ë¤¢¤ë²þ¹Ôʸ»ú¤Ïºï½ü¤µ¤ì¤Þ¤»¤ó¤¬¡¢Ã±¸ìʬ³ä¤ÎºÝ¤Ë
721 ºï½ü¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¥³¥Þ¥ó¥ÉÃÖ´¹ \fB$(cat \fIfile\fP)\fR ¤Ï¡¢Æ±
722 ¤¸°ÕÌ£¤ò»ý¤Á¡¢¤·¤«¤â¹â®¤Ê \fB$(< \fIfile\fP)\fR ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç
723 ¤­¤Þ¤¹¡£
724 .PP
725 .\"O When the old-style backquote form of substitution is used,
726 .\"O backslash retains its literal meaning except when followed by
727 .\"O .BR $ ,
728 .\"O .BR ` ,
729 .\"O or
730 .\"O .BR \e .
731 .\"O The first backquote not preceded by a backslash terminates the
732 .\"O command substitution.
733 .\"O When using the $(\^\fIcommand\fP\|) form, all characters between the
734 .\"O parentheses make up the command; none are treated specially.
735 ¥Ð¥Ã¥¯¥¯¥©¡¼¥È¤ò»È¤¦¸Å¤¤·Á¼°¤ÎÃÖ´¹¤òÍѤ¤¤¿¤È¤­¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ïʸ»ú
736 Ä̤ê¤Î°ÕÌ£¤òÊݤÁ¤Þ¤¹¤¬¡¢
737 .BR $ ,
738 .BR ` ,
739 .B \e
740 ¤ÎÁ°¤Ë¤¢¤ë¾ì¹ç¤ÏÎã³°¤È¤Ê¤ê¤Þ¤¹¡£¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤¬Á°¤ËÃÖ¤«¤ì¤Æ¤¤¤Ê¤¤ºÇ
741 ½é¤Î¥Ð¥Ã¥¯¥¯¥©¡¼¥È¤¬¤¢¤ë¤È¥³¥Þ¥ó¥ÉÃÖ´¹¤ÏÊĤ¸¤é¤ì¤Þ¤¹¡£
742 $(\^\fIcommand\fP\|) ¤È¤¤¤¦·Á¼°¤òÍѤ¤¤¿¤È¤­¤Ï¡¢³ç¸Ì¤Î´Ö¤Ë¤¢¤ëÁ´¤Æ¤Îʸ
743 »ú¤¬¥³¥Þ¥ó¥É¤È¤Ê¤ê¤Þ¤¹¡£ÆÃÊÌ°·¤¤¤µ¤ì¤ëʸ»ú¤Ï¤¢¤ê¤Þ¤»¤ó¡£
744 .PP
745 .\"O Command substitutions may be nested.  To nest when using the backquoted form,
746 .\"O escape the inner backquotes with backslashes.
747 ¥³¥Þ¥ó¥ÉÃÖ´¹¤ÏÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Ð¥Ã¥¯¥¯¥©¡¼¥È·Á¼°¤Î»þ¤ËÆþ¤ì
748 »Ò¤ò¹Ô¤¦¤Ë¤Ï¡¢Æ⦤ΥХ寥¯¥©¡¼¥È¤ò¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç¥¨¥¹¥±¡¼¥×¤·¤Þ¤¹¡£
749 .PP
750 .\"O If the substitution appears within double quotes, word splitting and
751 .\"O pathname expansion are not performed on the results.
752 ÃÖ´¹¤¬¥À¥Ö¥ë¥¯¥©¡¼¥ÈÆâÉô¤Ë¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ÃÖ´¹¤Î·ë²Ì¤ËÂФ¹¤ëñ¸ìʬ³ä¤È
753 ¥Ñ¥¹Ì¾Å¸³«¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó¡£
754 .\"O .SS Arithmetic Expansion
755 .SS »»½Ñ¼°Å¸³«
756 .PP
757 .\"O Arithmetic expansion allows the evaluation of an arithmetic expression
758 .\"O and the substitution of the result.  The format for arithmetic expansion is:
759 »»½Ñ¼°Å¸³«¤ò»È¤¦¤È¡¢»»½Ñ¼°¤òɾ²Á¤·¤Æ¡¢¤½¤Î·ë²Ì¤ËÃÖ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
760 »»½Ñ¼°Å¸³«¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¼¡¤Ë¼¨¤·¤Þ¤¹:
761 .RS
762 .PP
763 \fB$((\fP\fIexpression\fP\fB))\fP
764 .RE
765 .PP
766 .\"O The
767 .\"O .I expression
768 .\"O is treated as if it were within double quotes, but a double quote
769 .\"O inside the parentheses is not treated specially.
770 .\"O All tokens in the expression undergo parameter expansion, string
771 .\"O expansion, command substitution, and quote removal.
772 .\"O Arithmetic substitutions may be nested.
773 .I expression
774 ¤Ï¥À¥Ö¥ë¥¯¥©¡¼¥ÈÆâÉô¤Ë¤¢¤ë¾ì¹ç¤ÈƱÍͤ˰·¤ï¤ì¤Þ¤¹¤¬¡¢³ç¸Ì¤ÎÆ⦤ΥÀ¥Ö¥ë
775 ¥¯¥©¡¼¥È¤¬ÆÃÊÌ°·¤¤¤µ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¼°¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥È¡¼¥¯¥ó¤Ë
776 ÂФ·¤Æ¡¢¥Ñ¥é¥á¡¼¥¿Å¸³«¡¢Ê¸»úÎ󟳫¡¢¥³¥Þ¥ó¥ÉÃÖ´¹¡¢¥¯¥©¡¼¥È¤Îºï½ü¤¬¹Ô¤ï
777 ¤ì¤Þ¤¹¡£»»½Ñ¼°ÃÖ´¹¤ÏÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
778 .PP
779 .\"O The evaluation is performed according to the rules listed below under
780 .\"O .SM
781 .\"O .BR "ARITHMETIC EVALUATION" .
782 .\"O If
783 .\"O .I expression
784 .\"O is invalid,
785 .\"O .B bash
786 .\"O prints a message indicating failure and no substitution occurs.
787 ɾ²Á¤Ï¸å½Ò¤Î
788 .SM
789 .B "»»½Ñ¼°É¾²Á"
790 ¤Ç¼¨¤¹µ¬Â§¤Ë´ð¤Å¤¤¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£
791 .I expression
792 ¤¬ÉÔÀµ¤Ç¤¢¤ì¤Ð¡¢
793 .B bash
794 ¤Ïɾ²Á¤Î¼ºÇÔ¤ò¼¨¤¹¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢ÃÖ´¹¤òÁ´¤¯¹Ô¤¤¤Þ¤»¤ó¡£
795 .\"O .SS Process Substitution
796 .SS ¥×¥í¥»¥¹ÃÖ´¹
797 .PP
798 .\"O \fIProcess substitution\fP is supported on systems that support named
799 .\"O pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files.
800 .\"O It takes the form of
801 .\"O \fB<(\fP\fIlist\^\fP\fB)\fP
802 .\"O or
803 .\"O \fB>(\fP\fIlist\^\fP\fB)\fP.
804 \fI¥×¥í¥»¥¹ÃÖ´¹ (process substitution)\fP ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Î¤Ï¡¢Ì¾Á°ÉÕ¤­
805 ¥Ñ¥¤¥× (\fIFIFO\fP) ¤Þ¤¿¤Ï̾Á°ÉÕ¤­¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¤Î \fB/dev/fd\fP ¥á¥½¥Ã
806 ¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Ç¤¹¡£¤³¤ì¤Ï
807 \fB<(\fP\fIlist\^\fP\fB)\fP
808 ¤Þ¤¿¤Ï
809 \fB>(\fP\fIlist\^\fP\fB)\fP
810 ¤Î·Á¤Ë¤Ê¤ê¤Þ¤¹¡£
811 .\"O [³Îǧ] naming open file ¤ÎÌõ¸ì
812 .\"O The process \fIlist\fP is run with its input or output connected to a
813 .\"O \fIFIFO\fP or some file in \fB/dev/fd\fP.  The name of this file is
814 .\"O passed as an argument to the current command as the result of the
815 .\"O expansion.  If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to
816 .\"O the file will provide input for \fIlist\fP.  If the
817 .\"O \fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an
818 .\"O argument should be read to obtain the output of \fIlist\fP.
819 ¥×¥í¥»¥¹¤Î¥ê¥¹¥È \fIlist\fP ¤Î¼Â¹Ô»þ¤Ë¤Ï¡¢¤½¤ÎÆþÎϤޤ¿¤Ï½ÐÎϤϡ¢
820 \fIFIFO\fP ¤Þ¤¿¤Ï \fB/dev/fd\fP Ãæ¤Î²¿¤é¤«¤Î¥Õ¥¡¥¤¥ë¤ËÀܳ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
821 ¤³¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤ÏŸ³«¤Î·ë²Ì¤È¤·¤Æ¡¢°ú¤­¿ô¤È¤·¤Æ¸½ºß¤Î¥³¥Þ¥ó¥É¤ËÅϤµ
822 ¤ì¤Þ¤¹¡£\fB>(\fP\fIlist\^\fP\fB)\fP ¤Î·Á¼°¤ò»È¤Ã¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ
823 ¤­¹þ¤ß¤Ï \fIlist\fP ¤Ø¤ÎÆþÎϤȤʤê¤Þ¤¹¡£\fB<(\fP\fIlist\^\fP\fB)\fP ¤Î
824 ·Á¼°¤ò»È¤Ã¤¿¾ì¹ç¡¢°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï \fIlist\fP ¤Î½ÐÎϤòÆÀ
825 ¤ë¤¿¤á¤ËÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£
826 .PP
827 .\"O When available, process substitution is performed
828 .\"O simultaneously with parameter and variable expansion, 
829 .\"O command substitution,
830 .\"O and arithmetic expansion.
831 ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¥×¥í¥»¥¹ÃÖ´¹ (process substitution) ¤Ï¡¢
832 ¥Ñ¥é¥á¡¼¥¿Å¸³«¤äÊÑ¿ôŸ³«¡¢¥³¥Þ¥ó¥ÉÃÖ´¹¡¢»»½Ñ¼°Å¸³«¤ÈƱ»þ¤Ë¹Ô¤ï¤ì¤Þ¤¹¡£
833 .\"O .SS Word Splitting
834 .SS Ã±¸ì¤Îʬ³ä
835 .PP
836 .\"O The shell scans the results of
837 .\"O parameter expansion,
838 .\"O command substitution,
839 .\"O and
840 .\"O arithmetic expansion
841 .\"O that did not occur within double quotes for
842 .\"O .IR "word splitting" .
843 ¥·¥§¥ë¤Ï¥Ñ¥é¥á¡¼¥¿Å¸³«¤È¥³¥Þ¥ó¥ÉÃÖ´¹¡¢»»½Ñ¼°Å¸³«¤Î·ë²Ì¤ò¥¹¥­¥ã¥ó¤·¤Þ¤¹¡£
844 ¥À¥Ö¥ë¥¯¥©¡¼¥È¤ÎÆâÉô¤Ç¤Ï¡¢¤³¤ì¤é¤ÎŸ³«¤Ï
845 .I "ñ¸ìʬ³ä"
846 ¤ËÂФ·¤Æ¹Ô¤ï¤ì¤Þ¤»¤ó¡£
847 .\"O The shell treats each character of
848 .\"O .SM
849 .\"O .B IFS
850 .\"O as a delimiter, and splits the results of the other
851 .\"O expansions into words on these characters.  If
852 .\"O .SM
853 .\"O .B IFS
854 .\"O is unset, or its
855 .\"O value is exactly
856 .\"O .BR <space><tab><newline> ,
857 .\"O the default, then
858 .\"O any sequence of
859 .\"O .SM
860 .\"O .B IFS
861 .\"O characters serves to delimit words.  If
862 .\"O .SM
863 .\"O .B IFS
864 .\"O has a value other than the default, then sequences of
865 .\"O the whitespace characters
866 .\"O .B space
867 .\"O and
868 .\"O .B tab
869 .\"O are ignored at the beginning and end of the
870 .\"O word, as long as the whitespace character is in the
871 .\"O value of
872 .\"O .SM
873 .\"O .BR IFS
874 .\"O (an
875 .\"O .SM
876 .\"O .B IFS
877 .\"O whitespace character).
878 ¥·¥§¥ë¤Ï
879 .SM
880 .B IFS
881 ¤Î¤½¤ì¤¾¤ì¤Îʸ»ú¤ò¶èÀÚ¤êʸ»ú¤È¤·¤Æ°·¤¤¡¢Â¾¤ÎŸ³«¤Î·ë²Ì¤ò¤³¤ì¤é¤Îʸ»ú¤Ë¤è¤Ã¤Æ
882 ñ¸ì¤Ëʬ³ä¤·¤Þ¤¹¡£
883 .SM
884 .B IFS
885 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¤½¤ÎÃͤ¬Àµ³Î¤Ë¥Ç¥Õ¥©¥ë¥ÈÃͤÎ
886 .BR <¥¹¥Ú¡¼¥¹><¥¿¥Ö><²þ¹Ô>
887 ¤Ê¤é¤Ð¡¢
888 .SM
889 .B IFS
890 ʸ»ú¤ÎǤ°Õ¤ÎÎó¤Çñ¸ì¤¬¶èÀÚ¤é¤ì¤Þ¤¹¡£
891 .SM
892 .B IFS
893 ¤¬¥Ç¥Õ¥©¥ë¥È°Ê³°¤ÎÃͤò»ý¤Ã¤Æ¤¤¤ì¤Ð¡¢¶õÇòʸ»ú (
894 .B ¥¹¥Ú¡¼¥¹
895 ¤ª¤è¤Ó
896 .B ¥¿¥Ö
897 ) ¤ÎÎó¤Ïñ¸ì¤ÎÀèƬ¤ÈËöÈø¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¶õÇòʸ»ú¤¬
898 .SM
899 .BR IFS
900 ¤ÎÃÍ (
901 .SM
902 .B IFS
903 ¶õÇòʸ»ú) ¤Ë´Þ¤Þ¤ì¤ë¸Â¤êÀ®¤êΩ¤Á¤Þ¤¹¡£
904 .\"O Any character in
905 .\"O .SM
906 .\"O .B IFS
907 .\"O that is not
908 .\"O .SM
909 .\"O .B IFS
910 .\"O whitespace, along with any adjacent
911 .\"O .SM
912 .\"O .B IFS
913 .\"O whitespace characters, delimits a field.
914 .SM
915 .B IFS
916 ¤Ë´Þ¤Þ¤ì¡¢
917 .SM
918 .B IFS
919 ¶õÇòʸ»ú¤Ç¤Ï¤Ê¤¤Ê¸»ú¤ÏÁ´¤Æ¡¢ÎÙÀܤ¹¤ëǤ°Õ¤Î
920 .SM
921 .B IFS
922 ¶õÇòʸ»ú¤È°ì½ï¤Ë¤Ê¤Ã¤Æ¥Õ¥£¡¼¥ë¥É¤Î¶èÀÚ¤ê¤È¤Ê¤ê¤Þ¤¹¡£
923 .\"O A sequence of
924 .\"O .SM
925 .\"O .B IFS
926 .\"O whitespace characters is also treated as a delimiter.
927 .\"O If the value of
928 .\"O .SM
929 .\"O .B IFS
930 .\"O is null, no word splitting occurs.
931 .SM
932 .B IFS
933 ¶õÇòʸ»ú¤ÎÎó¤â¶èÀÚ¤êʸ»ú¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
934 .SM
935 .B IFS
936 ¤ÎÃͤ¬¶õʸ»úÎó¤Ç¤¢¤ì¤Ð¡¢Ã±¸ìʬ³ä¤ÏÁ´¤¯¹Ô¤ï¤ì¤Þ¤»¤ó¡£
937 .PP
938 .\"O Explicit null arguments (\^\f3"\^"\fP or \^\f3'\^'\fP\^) are retained.
939 .\"O Unquoted implicit null arguments, resulting from the expansion of
940 .\"O parameters that have no values, are removed.
941 .\"O If a parameter with no value is expanded within double quotes, a
942 .\"O null argument results and is retained.
943 ÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¶õ¤Î°ú¤­¿ô(\^\f3"\^"\fP ¤Þ¤¿¤Ï \^\f3'\^'\fP\^)¤Ïºï½ü¤µ
944 ¤ì¤º¤Ë»Ä¤ê¤Þ¤¹¡£¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡¢°ÅÌÛŪ¤Ë»ØÄꤵ¤ì¤¿¶õ¤Î°ú¤­¿ô¤Ï¡¢
945 Ãͤò»ý¤¿¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤òŸ³«¤·¤¿·ë²Ì¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¤¬¡¢¤³¤ì¤é¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£
946 Ãͤò»ý¤¿¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤¬¥À¥Ö¥ë¥¯¥©¡¼¥ÈÆâÉô¤ÇŸ³«¤µ¤ì¤ë¤È¡¢
947 ¤³¤ì¤Ï¶õ¤Ç¤¢¤ë°ú¤­¿ô¤È¤Ê¤ê¡¢¾Ã¤µ¤ì¤º¤Ë»Ä¤ê¤Þ¤¹¡£
948 .PP
949 .\"O Note that if no expansion occurs, no splitting
950 .\"O is performed.
951 Ÿ³«¤¬¹Ô¤ï¤ì¤Ê¤±¤ì¤Ðñ¸ìʬ³ä¤â¹Ô¤ï¤ì¤Ê¤¤ÅÀ¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
952 .\"O .SS Pathname Expansion
953 .SS ¥Ñ¥¹Ì¾Å¸³«
954 .PP
955 .\"O After word splitting,
956 .\"O unless the
957 .\"O .B \-f
958 .\"O option has been set,
959 .\"O .B bash
960 .\"O scans each word for the characters
961 .\"O .BR * ,
962 .\"O .BR ? ,
963 .\"O and
964 .\"O .BR [ .
965 .B \-f
966 ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢Ã±¸ìʬ³ä¤ò¹Ô¤Ã¤¿¸å¤Ë
967 .B bash
968 ¤Ï¤½¤ì¤¾¤ì¤Îñ¸ì¤¬
969 .BR * ,
970 .BR ? ,
971 .B [
972 ¤ò´Þ¤ó¤Ç¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¤Þ¤¹¡£
973 .\"O If one of these characters appears, then the word is
974 .\"O regarded as a
975 .\"O .IR pattern ,
976 .\"O and replaced with an alphabetically sorted list of
977 .\"O file names matching the pattern.
978 ¤³¤ì¤é¤Îʸ»ú¤Î¤¤¤º¤ì¤«¤¬¸«¤Ä¤«¤ë¤È¡¢¤½¤Îñ¸ì¤Ï
979 .IR ¥Ñ¥¿¡¼¥ó
980 ¤È¸«¤Ê¤µ¤ì¡¢¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Õ¥¡¥¤¥ë̾¤ò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ë¥½¡¼¥È¤·
981 ¤¿¥ê¥¹¥È¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£
982 .\"O If no matching file names are found,
983 .\"O and the shell option
984 .\"O .B nullglob
985 .\"O is disabled, the word is left unchanged.
986 ¥Þ¥Ã¥Á¤¹¤ë¥Õ¥¡¥¤¥ë̾¤¬¸«¤Ä¤«¤é¤º¡¢¤«¤Ä¥·¥§¥ë¤Î¥ª¥×¥·¥ç¥ó
987 .B nullglob
988 ¤¬Ìµ¸ú¤Ê¤é¤Ð¡¢¤½¤Îñ¸ì¤ÏÊѹ¹¤µ¤ì¤º¤Ë¤½¤Î¤Þ¤Þ»Ä¤ê¤Þ¤¹¡£
989 .\"O If the 
990 .\"O .B nullglob
991 .\"O option is set, and no matches are found,
992 .\"O the word is removed.
993 .B nullglob
994 ¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä¥Þ¥Ã¥Á¤¹¤ë¥Õ¥¡¥¤¥ë̾¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢¤½¤Î
995 ñ¸ì¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£
996 .\"O If the shell option
997 .\"O .B nocaseglob
998 .\"O is enabled, the match is performed without regard to the case
999 .\"O of alphabetic characters.
1000 ¥·¥§¥ë¤Î¥ª¥×¥·¥ç¥ó
1001 .B nocaseglob
1002 ¤¬Í­¸ú¤Ê¤é¤Ð¡¢¥Þ¥Ã¥Á¥ó¥°¤Ë¤ª¤¤¤Æ¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤ÎÂçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ
1003 ¤ì¤Þ¤»¤ó¡£
1004 .\"O When a pattern is used for pathname expansion,
1005 .\"O the character
1006 .\"O .B ``.''
1007 .\"O at the start of a name or immediately following a slash
1008 .\"O must be matched explicitly, unless the shell option
1009 .\"O .B dotglob
1010 .\"O is set.
1011 ¥Ñ¥¿¡¼¥ó¤ò¥Ñ¥¹Ì¾Å¸³«¤Ë»È¤¦¤È¤­¡¢Ì¾Á°¤ÎÀèƬ¤ä¥¹¥é¥Ã¥·¥å¤Îľ¸å¤Î
1012 .B ``.''
1013 ¤ÏÌÀ¼¨Åª¤Ë¥Þ¥Ã¥Á¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¿¤À¤·¡¢¥·¥§¥ë¤Î¥ª¥×¥·¥ç¥ó
1014 .B dotglob
1015 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï½ü¤­¤Þ¤¹¡£
1016 .\"O When matching a pathname, the slash character must always be
1017 .\"O matched explicitly.
1018 .\"O In other cases, the
1019 .\"O .B ``.''
1020 .\"O character is not treated specially.
1021 ¥Ñ¥¹Ì¾¤Î¥Þ¥Ã¥Á¥ó¥°¤ò¹Ô¤¦¤È¤­¡¢¥¹¥é¥Ã¥·¥åʸ»ú¤Ïɬ¤ºÌÀ¼¨Åª¤Ë¥Þ¥Ã¥Á¤µ¤»¤Ê
1022 ¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤³¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢
1023 .B ``.''
1024 ¤¬ÆÃÊÌ°·¤¤¤µ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
1025 .\"O See the description of
1026 .\"O .B shopt
1027 .\"O below under
1028 .\"O .SM
1029 .\"O .B SHELL BUILTIN COMMANDS
1030 .\"O for a description of the
1031 .\"O .BR nocaseglob ,
1032 .\"O .BR nullglob ,
1033 .\"O and
1034 .\"O .B dotglob
1035 .\"O shell options.
1036 ¥·¥§¥ë¤Î¥ª¥×¥·¥ç¥ó
1037 .BR nocaseglob ,
1038 .BR nullglob ,
1039 .B dotglob
1040 ¤Î¾Ü¤·¤¤ÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¸å½Ò¤Î
1041 .SM
1042 .B ¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É
1043 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë
1044 .B shopt
1045 ¤ÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
1046 .PP
1047 .\"O The
1048 .\"O .SM
1049 .\"O .B GLOBIGNORE
1050 .\"O shell variable may be used to restrict the set of file names matching a
1051 .\"O .IR pattern .
1052 ¥·¥§¥ëÊÑ¿ô
1053 .SM
1054 .B GLOBIGNORE
1055 ¤ò»È¤Ã¤Æ¡¢
1056 .I ¥Ñ¥¿¡¼¥ó
1057 ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Õ¥¡¥¤¥ë̾¤Î½¸¹ç¤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
1058 .\"O If
1059 .\"O .SM
1060 .\"O .B GLOBIGNORE
1061 .\"O is set, each matching file name that also matches one of the patterns in
1062 .\"O .SM
1063 .\"O .B GLOBIGNORE
1064 .\"O is removed from the list of matches.
1065 .SM
1066 .B GLOBIGNORE
1067 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¥Þ¥Ã¥Á¤¹¤ë¥Õ¥¡¥¤¥ë̾¤Î¤¦¤Á
1068 .SM
1069 .B GLOBIGNORE
1070 Ãæ¤Î¥Ñ¥¿¡¼¥ó¤Ë¤â¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤Î¥ê¥¹¥È¤«¤é¼è¤ê½ü¤«¤ì
1071 ¤Þ¤¹¡£
1072 .\"O The file names
1073 .\"O .B ``.''
1074 .\"O and
1075 .\"O .B ``..''
1076 .\"O are always ignored, even when
1077 .\"O .SM
1078 .\"O .B GLOBIGNORE
1079 .\"O is set.  However, setting
1080 .\"O .SM
1081 .\"O .B GLOBIGNORE
1082 .\"O has the effect of enabling the
1083 .\"O .B dotglob
1084 .\"O shell option, so all other file names beginning with a
1085 .\"O .B ``.''
1086 .\"O will match.
1087 ¥Õ¥¡¥¤¥ë̾
1088 .B ``.''
1089 ¤È
1090 .B ``..''
1091 ¤Ïɬ¤ºÌµ»ë¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï
1092 .SM
1093 .B GLOBIGNORE
1094 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¤âƱ¤¸¤Ç¤¹¡£¤·¤«¤·¡¢
1095 .SM
1096 .B GLOBIGNORE
1097 ¤òÀßÄꤹ¤ë¤È¥·¥§¥ë¥ª¥×¥·¥ç¥ó¤Î
1098 .B dotglob
1099 ¤¬Í­¸ú¤Ë¤Ê¤ë¤Î¤Ç¡¢
1100 .B ``.''
1101 ¤Ç»Ï¤Þ¤ë¾¤Î¥Õ¥¡¥¤¥ë̾¤ÏÁ´¤Æ¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1102 .\"O To get the old behavior of ignoring file names beginning with a
1103 .\"O .BR ``.'' ,
1104 .\"O make
1105 .\"O .B ``.*''
1106 .\"O one of the patterns in
1107 .\"O .SM
1108 .\"O .BR GLOBIGNORE .
1109 .B ``.''
1110 ¤Ç»Ï¤á¤ë¥Õ¥¡¥¤¥ë̾¤ò̵»ë¤¹¤ë¸Å¤¤Æ°ºî¤ò¤µ¤»¤ë¤Ë¤Ï¡¢
1111 .B ``.*''
1112 ¤ò
1113 .SM
1114 .B GLOBIGNORE
1115 ¤Î¥Ñ¥¿¡¼¥ó¤Ë´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£
1116 .\"O The
1117 .\"O .B dotglob
1118 .\"O option is disabled when
1119 .\"O .SM
1120 .\"O .B GLOBIGNORE
1121 .\"O is unset.
1122 .SM
1123 .B GLOBIGNORE
1124 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
1125 .B dotglob
1126 ¥ª¥×¥·¥ç¥ó¤Ï̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
1127 .PP
1128 .\"O \fBPattern Matching\fP
1129 \fB¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°\fP
1130 .PP
1131 .\"O Any character that appears in a pattern, other than the special pattern
1132 .\"O characters described below, matches itself.  The NUL character may not
1133 .\"O occur in a pattern.  The special pattern characters must be quoted if
1134 .\"O they are to be matched literally.
1135 ¥Ñ¥¿¡¼¥ó¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Î¤¦¤Á¡¢¸å½Ò¤¹¤ëÆüì¥Ñ¥¿¡¼¥óʸ»ú°Ê³°¤Îʸ»ú¤Ï¡¢¼«
1136 ʬ¼«¿È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£NUL Ê¸»ú¤¬¥Ñ¥¿¡¼¥óÃæ¤Ë¸½¤ï¤ì¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£Æüì
1137 ¥Ñ¥¿¡¼¥óʸ»ú¤ò¤½¤Îʸ»ú¤½¤Î¤â¤Î¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢¥¯¥©¡¼¥È¤·¤Ê¤±¤ì
1138 ¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
1139 .PP
1140 .\"O The special pattern characters have the following meanings:
1141 Æüì¥Ñ¥¿¡¼¥óʸ»ú¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹:
1142 .PP
1143 .PD 0
1144 .TP
1145 .B *
1146 .\"O Matches any string, including the null string.
1147 ¶õʸ»úÎó¤ò´Þ¤à¡¢Ç¤°Õ¤Îʸ»úÎó¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1148 .TP
1149 .B ?
1150 .\"O Matches any single character.
1151 Ǥ°Õ¤Î 1 Ê¸»ú¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1152 .TP
1153 .B [...]
1154 .\"O Matches any one of the enclosed characters.  A pair of characters
1155 .\"O separated by a minus sign denotes a
1156 .\"O .IR range ;
1157 .\"O any character lexically between those two characters, inclusive,
1158 .\"O is matched.  If the first character following the
1159 .\"O .B [
1160 .\"O is a
1161 .\"O .B !
1162 .\"O or a
1163 .\"O .B ^
1164 .\"O then any character not enclosed is matched.
1165 ³ç¤é¤ì¤¿Ê¸»ú¤Î¤¦¤ÁǤ°Õ¤Î 1 Ê¸»ú¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£2 ¤Ä¤Îʸ»ú¤Î´Ö¤Ë¥Þ¥¤¥Ê
1166 ¥¹µ­¹æ¤òÆþ¤ì¤¿¤â¤Î¤Ï¡¢
1167 .I ÈÏ°Ï
1168 ¤òɽ¤·¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢¼­½ñŪ¤Ë 2 ¤Ä¤Îʸ»ú¤Î´Ö¤Ë¤Ê¤ëǤ°Õ¤Îʸ»ú¤È¡¢Î¾Ã¼¤Î
1169  2 Ê¸»ú¤¬¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1170 .B [
1171 ¤Î¼¡¤Îʸ»ú¤¬
1172 .B !
1173 ¤Þ¤¿¤Ï
1174 .B ^
1175 ¤Ê¤é¤Ð¡¢³ç¤é¤ì¤¿Ê¸»ú¤Ë´Þ¤Þ¤ì¤Ê¤¤Ç¤°Õ¤Îʸ»ú¤¬¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1176 .\"O A 
1177 .\"O .B \-
1178 .\"O may be matched by including it as the first or last character
1179 .\"O in the set.
1180 .B \-
1181 ¤Ï¡¢Ê¸»ú½¸¹ç¤ÎºÇ½é¤Þ¤¿¤ÏºÇ¸å¤Îʸ»ú¤È¤·¤Æ´Þ¤á¤ë¤È¥Þ¥Ã¥Á¥ó¥°¤ÎÂоݤˤ¹¤ë
1182 ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
1183 .\"O A
1184 .\"O .B ]
1185 .\"O may be matched by including it as the first character
1186 .\"O in the set.
1187 .B ]
1188 ¤Ï¡¢Ê¸»ú½¸¹ç¤ÎºÇ½é¤Îʸ»ú¤È¤·¤Æ´Þ¤á¤ë¤È¥Þ¥Ã¥Á¥ó¥°¤ÎÂоݤˤ¹¤ë¤³¤È¤¬¤Ç¤­
1189 ¤Þ¤¹¡£
1190 .br
1191 .if t .sp 0.5
1192 .if n .sp 1
1193 .\"O Within
1194 .\"O .B [
1195 .\"O and
1196 .\"O .BR ] ,
1197 .\"O \fIcharacter classes\fP can be specified using the syntax
1198 .\"O \fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the
1199 .\"O following classes defined in the POSIX.2 standard:
1200 .B [
1201 ¤È
1202 .B ]
1203 ¤Î´Ö¤Ç¤Ï¡¢\fIʸ»ú¥¯¥é¥¹ (character classes)\fP ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
1204 »ØÄê¤Ë¤Ï \fB[:\fP\fIclass\fP\fB:]\fP ¤È¤¤¤¦µ­Ë¡¤ò»È¤¤¤Þ¤¹¡£¤³¤³¤Ç¡¢
1205 \fIclass\fP ¤Ï POSIX.2 É¸½à¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë°Ê²¼¤Î¥¯¥é¥¹¤Î¤¤¤º¤ì¤«¤Ç¤¹:
1206 .PP
1207 .RS
1208 .B
1209 .if n alnum alpha ascii blank cntrl digit graph lower print punct space upper xdigit
1210 .if t alnum   alpha   ascii   blank   cntrl   digit   graph   lower   print   punct   space   upper   xdigit
1211 .br
1212 .\"O A character class matches any character belonging to that class.
1213 ʸ»ú¥¯¥é¥¹¤Ï¡¢¤½¤Î¥¯¥é¥¹¤Î°¤¹¤ëǤ°Õ¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1214 .br
1215 .if t .sp 0.5
1216 .if n .sp 1
1217 .\"O Within
1218 .\"O .B [
1219 .\"O and 
1220 .\"O .BR ] ,
1221 .\"O an \fIequivalence class\fP can be specified using the syntax
1222 .\"O \fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the
1223 .\"O same collation weight (as defined by the current locale) as
1224 .\"O the character \fIc\fP.
1225 .B [
1226 ¤È
1227 .B ]
1228 ¤Î´Ö¤Ç¤Ï¡¢\fIƱÃÍ¥¯¥é¥¹ (equivalence class)\fP ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
1229 »ØÄê¤Ë¤Ï \fB[=\fP\fIc\fP\fB=]\fP ¤È¤¤¤¦µ­Ë¡¤ò»È¤¤¤Þ¤¹¡£¤³¤ì¤Ï \fIc\fP 
1230 ¤ÈƱ¤¸¾È¹ç¤Î½Å¤ßÉÕ¤± (collation weight, ¸½ºß¤Î¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë
1231 Ãͤ¬»ÈÍѤµ¤ì¤Þ¤¹) ¤ò»ý¤ÄÁ´¤Æ¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1232 .br
1233 .if t .sp 0.5
1234 .if n .sp 1
1235 .\"O Within
1236 .\"O .B [
1237 .\"O and 
1238 .\"O .BR ] ,
1239 .\"O the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol
1240 .\"O \fIsymbol\fP.
1241 .B [
1242 ¤È
1243 .B ]
1244 ¤Î´Ö¤Ç¤Ï¡¢\fB[.\fP\fIsymbol\fP\fB.]\fP ¤È¤¤¤¦µ­½Ò¤Ï¾È¹ç¥·¥ó¥Ü¥ë
1245 \fIsymbol\fP ¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1246 .\"O WORD: collating symbol     ¾È¹ç¥·¥ó¥Ü¥ë
1247 .RE
1248 .PD
1249 .PP
1250 .\"O If the \fBextglob\fP shell option is enabled using the \fBshopt\fP
1251 .\"O builtin, several extended pattern matching operators are recognized.
1252 .\"O In the following description, a \fIpattern-list\fP is a list of one
1253 .\"O or more patterns separated by a \fB|\fP.
1254 .\"O Composite patterns may be formed using one or more of the following
1255 .\"O sub-patterns:
1256 ÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Î \fBshopt\fP ¤ò»È¤Ã¤Æ¥·¥§¥ë¤Î¥ª¥×¥·¥ç¥ó
1257 \fBextglob\fP ¤¬Í­¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¤È¡¢³ÈÄ¥¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°±é»»»Ò¤¬¤¤¤¯
1258 ¤Ä¤«Ç§¼±¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢\fIpattern-list\fP ¤Ï
1259 \fB|\fP ¤Ç¶èÀÚ¤é¤ì¤¿ 1 ¤Ä°Ê¾å¤Î¥Ñ¥¿¡¼¥ó¤Î¥ê¥¹¥È¤Ç¤¢¤ë¤â¤Î¤È¤·¤Þ¤¹¡£°Ê
1260 ²¼¤Î¥µ¥Ö¥Ñ¥¿¡¼¥ó¤ò 1 ¤Ä¤¢¤ë¤¤¤ÏÊ£¿ô»È¤¦¤³¤È¤Ë¤è¤ê¡¢Ê£¹ç¥Ñ¥¿¡¼¥ó¤òºî¤ë
1261 ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
1262 .\"O WORD: composite pattern    Ê£¹ç¥Ñ¥¿¡¼¥ó
1263 .\"O WORD: sub-pattern  ¥µ¥Ö¥Ñ¥¿¡¼¥ó
1264 .sp 1
1265 .PD 0
1266 .RS
1267 .TP
1268 \fB?(\fP\^\fIpattern-list\^\fP\fB)\fP
1269 .\"O Matches zero or one occurrence of the given patterns
1270 Í¿¤¨¤é¤ì¤¿¥Ñ¥¿¡¼¥ó¤¬ 0 ²ó¤Þ¤¿¤Ï 1 ²ó¸½¤ï¤ì¤ë¤È¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1271 .TP
1272 \fB*(\fP\^\fIpattern-list\^\fP\fB)\fP
1273 .\"O Matches zero or more occurrences of the given patterns
1274 Í¿¤¨¤é¤ì¤¿¥Ñ¥¿¡¼¥ó¤¬ 0 ²ó°Ê¾å¸½¤ï¤ì¤ë¤È¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1275 .TP
1276 \fB+(\fP\^\fIpattern-list\^\fP\fB)\fP
1277 .\"O Matches one or more occurrences of the given patterns
1278 Í¿¤¨¤é¤ì¤¿¥Ñ¥¿¡¼¥ó¤¬ 1 ²ó°Ê¾å¸½¤ï¤ì¤ë¤È¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1279 .TP
1280 \fB@(\fP\^\fIpattern-list\^\fP\fB)\fP
1281 .\"O Matches exactly one of the given patterns
1282 Í¿¤¨¤é¤ì¤¿¥Ñ¥¿¡¼¥ó¤Î¤¦¤Á 1 ¤Ä¤À¤±¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1283 .TP
1284 \fB!(\fP\^\fIpattern-list\^\fP\fB)\fP
1285 .\"O Matches anything except one of the given patterns
1286 Í¿¤¨¤é¤ì¤¿¥Ñ¥¿¡¼¥ó¤¤¤º¤ì¤Ë¤â´Þ¤Þ¤ì¤Ê¤¤¤â¤ÎÁ´¤Æ¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
1287 .RE
1288 .PD
1289 .\"O .SS Quote Removal
1290 .SS ¥¯¥©¡¼¥È¤Îºï½ü
1291 .PP
1292 .\"O After the preceding expansions, all unquoted occurrences of the
1293 .\"O characters
1294 .\"O .BR \e ,
1295 .\"O .BR ' ,
1296 .\"O and \^\f3"\fP\^ that did not result from one of the above
1297 .\"O expansions are removed.
1298 Àè¤Ë½èÍý¤µ¤ì¤ëŸ³«¤Î¸å¡¢¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤
1299 .BR \e ,
1300 .BR ' ,
1301 \^\f3"\fP\^ 
1302 ¤Î¤¦¤Á¡¢Àè¤ÎŸ³«¤Î·ë²Ì¤Ç¤Ê¤¤¤â¤Î¤ÏÁ´¤Æºï½ü¤µ¤ì¤Þ¤¹¡£