OSDN Git Service

53fbe9cb18685d9e9b774f5376535482e85318ea
[linuxjm/jm.git] / info / GNU_which / draft / which-ja.texi
1 \input texinfo   @c -*-texinfo-*-
2 @c ===========================================================================
3 @c
4 @c This file was generated with po4a. Translate the source file.
5 @c
6 @c ===========================================================================
7 @c %**start of header
8 @setfilename which-ja.info
9 @documentencoding UTF-8
10 @settitle @command{which}: コマンドのフルパスを表示する
11 @include version.texi
12 @dircategory System administration
13 @direntry
14 * Which-ja: (which-ja).      Show full path of commands.
15 @end direntry
16 @c %**end of header
17
18 @setchapternewpage odd
19
20 @ifinfo
21 @format
22
23 @c !BEGIN INTRO
24 @c !END INTRO
25 This file documents `which' version 2.x@.
26
27 @c !BEGIN COPYING
28 Copyright @copyright{} 2000 - 2015, by
29
30 Carlo Wood, Run on IRC <carlo@@alinoe.com>
31 RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
32 Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
33
34 Japanese Translation Copyright @copyright{} 2023 Linux JM project
35
36 Permission is granted to make and distribute verbatim copies of
37 this manual provided the copyright notice and this permission notice
38 are preserved on all copies.
39 @end format
40
41 @c @ignore
42 Permission is granted to copy and distribute modified versions of this
43 manual under the conditions for verbatim copying, provided also that the
44 section entitled ``GNU General Public License'' is included exactly as
45 in the original, and provided that the entire resulting derived work is
46 distributed under the terms of a permission notice identical to this
47 one.
48
49 Permission is granted to copy and distribute translations of this manual
50 into another language, under the above conditions for modified versions,
51 except that the section entitled ``GNU General Public License'' may be
52 included in a translation approved by the author instead of in the
53 original English.
54
55 Note (by the translator): Actually, ``GNU General Public License''
56 is not included in the original version of this info manual.  
57 You will get a copy of it at <https://www.gnu.org/licenses/>.
58 @c @end ignore
59 @c !END COPYING
60 @end ifinfo
61
62 @titlepage
63 @title Which
64 @subtitle コマンドのフルパスを表示する
65 @sp 1
66 @subtitle Edition @value{EDITION}, for Which Version @value{VERSION}
67 @subtitle @value{UPDATED}
68 @c !BEGIN AUTHORS
69 @author Carlo Wood <@email{carlo@@gnu.org}>
70 @author Translated by Linux JM project
71 @c !END AUTHORS
72 @page
73 @vskip 0pt plus 1filll
74 Copyright @copyright{} 2000 - 2015, by
75
76 Carlo Wood, Run on IRC <carlo@@alinoe.com> RSA-1024 0x624ACAD5 1997-01-26
77 Sign & Encrypt Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF
78 61
79 @sp 1
80 Japanese Translation Copyright @copyright{} 2023 Linux JM project
81
82 @c The history of the translation
83 @c     Translated (version 2.21) Fri Mar  3 11:49:31 JST 2023
84 @c         by Chonan Yoichi <cyoichi@maple.con.ne.jp>
85
86 @end titlepage
87
88 @ifnottex
89 @node Top, Which Program, (dir), (dir)
90 @top @command{which}: コマンドのフルパスを表示する
91 @end ifnottex
92
93 @ifinfo
94 @c !BEGIN NAME
95 @c !END NAME
96 @command{which} プログラムは、(シェル) コマンドのフルパスを表示する。
97
98 @noindent
99 このファイルは、@command{which} version @value{VERSION}
100 (@value{UPDATED} に更新) について解説している。
101
102 @noindent
103 【読者への御注意】これは、GNU 版の @command{which} コマンドのマニュアルである。
104 @command{which} の実装には、いくつかの系統があるので、お手元の @command{which}
105 が別系統であるときは、オプションなどがここで説明しているものとかなり違うかもしれない。
106 そのときは、お手元の @command{which} に付属するマニュアルをご覧になっていただきたい。
107 @end ifinfo
108
109 @menu
110 * Which Program::            @command{which} プログラムについて
111 * Invoking Which::           @command{which} の起動
112 * Option Summary::           コマンドラインオプション一覧
113 * Return Value::             @command{which} の返り値
114 * Example::                  用例
115 * Bugs::                     既知のバグ
116 * See Also::                 関連する UNIX コマンド
117 * Index::                    索引
118 @end menu
119
120 @node Which Program, Invoking Which, Top, Top
121 @chapter @command{which} プログラムについて
122 @cindex @command{which} の説明
123
124 @c !BEGIN DESCRIPTION
125 @c !END DESCRIPTION
126 @command{Which} は、ひとつ以上の引数を取り、
127 そうした引数のそれぞれについて、それがシェルのプロンプトから入力されていたら、
128 実行されていたであろう実行ファイルのフルパスを標準出力に表示する。@command{Which}
129 は、それを行うに当たり、@command{bash(1)} と同じアルゴリズムを使って、環境変数
130 @env{PATH} にリストされたディレクトリを調べ、実行ファイルやスクリプトを捜す。
131
132 @node Invoking Which, Option Summary, Which Program, Top
133 @chapter @command{which} の起動
134 @cindex @command{which} の起動
135 @cindex 書式
136
137 @noindent
138 @command{which} 起動の書式は、次のとおりである。
139
140 @c !BEGIN SYNOPSIS
141 @example
142 which [options] [--] programname [...]
143 @end example
144 @c !END SYNOPSIS
145
146 @c 以下のメニューはない方がよいので、コメントにしておく。
147 @c @menu
148 @c * Option Summary::           Option summary
149 @c @end menu
150
151 @node Option Summary, Return Value, Invoking Which, Top
152 @chapter オプション一覧
153 @cindex オプション、コマンドライン
154 @cindex コマンドライン・オプション
155 @cindex コマンドラインオプション一覧
156
157 @c !BEGIN OPTIONS
158 @table @samp
159 @cindex @option{--all}
160 @cindex @option{-a}
161 @item --all
162 @itemx -a
163 @env{PATH} 中で最初に引数に一致したものだけでなく、一致したすべての実行ファイルを表示する。
164
165 @cindex @option{--read-alias}
166 @cindex @option{-i}
167 @item --read-alias
168 @itemx -i
169 標準入力からエイリアスを読み込んで、引数に一致するものを標準出力に書き出す。
170 このオプションは、which コマンドの代わりにエイリアスを使用する場合に、その中で使うとよい。
171 たとえば、次のようにだ。@*
172 @code{alias which='alias | which -i'}
173
174 @cindex @option{--skip-alias}
175 @item --skip-alias
176 @option{--read-alias} オプションが指定されていても、それを無視する。
177 このオプションは、which の代わりに使うエイリアスや関数で @option{--read-alias}
178 オプションを使用している場合に、通常のバイナリを明示的に探すのに役に立つ。
179
180 @cindex @option{--read-functions}
181 @item --read-functions
182 標準入力からシェル関数の定義を読み込んで、引数に一致するものを標準出力に書き出す。
183 このオプションは、which コマンドの代わりにシェル関数を使用する場合に、
184 その中で使うとよい。たとえば、次のようにだ。@* @code{which () @{ declare -f |
185 /usr/bin/which --read-functions $@@; @}@*export -f which}
186
187 @cindex @option{--skip-functions}
188 @item --skip-functions
189 @option{--read-functions} が指定されていても、それを無視する。
190 このオプションは、which の代わりに使うエイリアスや関数で @option{--read-functions}
191 オプションを使用している場合に、通常のバイナリを明示的に捜すのに役に立つ。
192
193 @cindex @option{--skip-dot}
194 @item --skip-dot
195 環境変数 @env{PATH} 中のドット (.) で始まるパスをスキップする。
196 @footnote{環境変数 @env{PATH} に '.' や './bin'、'.local'
197 などが登録されている場合のことを言っている。'$HOME/.local'
198 といったディレクトリのことではない。そのへんの事情は、@option{--show-dot}
199 でも同じである。}
200
201 @cindex @option{--skip-tilde}
202 @item --skip-tilde
203 @env{PATH} 中のチルダ (~) で始まるディレクトリと、@env{HOME}
204 ディレクトリ以下にある実行ファイルをスキップする。
205
206 @cindex @option{--show-dot}
207 @item --show-dot
208 @env{PATH} 中にドット (.) で始まるパスがあるとき、
209 それに対応するディレクトリで引数に一致する実行ファイルが見つかったら、
210 フルパスではなく "./programname" などと表示する。
211
212 @cindex @option{--show-tilde}
213 @item --show-tilde
214 ディレクトリに @env{HOME} ディレクトリが含まれているときは、チルダを出力する。
215 このオプションは、@command{which} が root の権限で実行されている場合には無視される。
216
217 @cindex @option{--tty-only}
218 @item --tty-only
219 出力が端末でない場合は、これより右にあるオプションの処理をしない。
220 @footnote{このオプションに効果があるのは、@option{--show-dot},
221 @option{--show-tilde}, @option{--skip-dot}, @option{--skip-tilde}
222 に対してだけのようである。}
223
224 @cindex @option{--version}
225 @cindex @option{-v}
226 @cindex @option{-V}
227 @item --version, -v, -V
228 バージョン情報を標準出力に表示して、正常終了する。
229
230 @cindex @option{--help}
231 @item --help
232 使用法を標準出力に表示して、正常終了する。
233
234 @end table
235 @c !END OPTIONS
236
237 @node Return Value, Example, Option Summary, Top
238 @chapter 返り値
239 @cindex @command{which} の返り値
240
241 @c !BEGIN RETURNVALUE
242 @c !END RETURNVALUE
243 @command{Which} は、検索に失敗した引数の個数を返す。引数に
244 @file{programname} が指定されなかった場合には、-1 を返す。
245
246 @node Example, Bugs, Return Value, Top
247 @chapter 用例
248 @cindex 用例
249 @cindex エイリアスの使用
250
251 @c !BEGIN EXAMPLE
252 このユーティリティの使用に当たっては、以下のように、エイリアスや
253 (C shell の場合) シェル関数に (Bourne shell の場合)、@command{which}
254 コマンドの代わりに使用するものを追加しておくことをおすすめする。
255
256 [ba]sh:
257
258 @example
259 @group
260 which ()
261 @{
262   (alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@@
263 @}
264 export -f which
265 @end group
266 @end example
267
268 [t]csh:
269
270 @example
271 @group
272 alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
273 @end group
274 @end example
275
276 @noindent
277 このようにしておくと、which をプロンプトから実行したときには、パスを ~/
278 や ./ という読みやすい形で表示するが、スクリプトから使用した場合には、
279 通常どおりフルパスの表示になる。@footnote{
280 実際には、こうした関数やエイリアスを端末のプロンプトから実行しようと、
281 スクリプトから実行しようと、表示に変わりはない。
282 出力先が、標準出力や標準エラーか、それ以外かで違いが生じるようである
283 (実行例の二番目では、標準入力に出力している)。念のため、ご自分でお試しいただきたい。}
284
285 @example
286 @group
287 > which q2
288 ~/bin/q2
289 > echo `which q2`
290 /home/carlo/bin/q2
291 @end group
292 @end example
293 @c !END EXAMPLE
294
295 @node Bugs, See Also, Example, Top
296 @chapter バグ
297 @cindex 既知のバグ
298
299 @c !BEGIN BUGS
300 @c !END BUGS
301 @env{HOME} ディレクトリの特定は、環境変数 @env{HOME}
302 を調べることで行われるが、この変数が存在しない場合は、@env{HOME}
303 ディレクトリの特定作業は打ち切られる。@footnote{
304 この記述は古いようだ。パッケージ同梱の NEWS ファイルによれば、which-2.19
305 以来、環境変数 @env{HOME} が設定されていない場合は、/etc/passwd
306 ファイルが調べられ、そこでも指定されていない場合は、'/'
307 がホームディレクトリになるとのことである。}
308 また、@command{Which} は、二つのディレクトリが事実上同じものであっても、
309 片方のパスにシンボリックリンクが含まれている場合は、別のディレクトリと見なすことになる。
310
311 @node See Also, Index, Bugs, Top
312 @chapter 関連項目
313
314 @c !BEGIN SEEALSO
315 @c !END SEEALSO
316 @command{bash(1)}
317
318 @node Index, , See Also, Top
319 @comment node-name,    next,  previous,       up
320 @unnumbered 索引
321
322 @printindex cp
323
324 @contents
325 @bye