aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man1/apply.1
blob: 2460b0b11b91d395173e963cf3adb0f431131429 (plain) (blame)
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
.\" Copyright (c) 1983, 1990, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)apply.1	8.2 (Berkeley) 4/4/94
.\" jpman %Id: apply.1,v 1.2 1997/03/26 12:22:42 horikawa Stab %
.\"
.Dd April 4, 1994
.Dt APPLY 1
.Os BSD 4.2
.Sh 名称
.Nm apply
.Nd 引数の集合にコマンドを適用する
.Sh 書式
.Nm apply
.Op Fl a Ns Ar c
.Op Fl Ns Ar #
.Ar command argument ...
.Sh 解説
.Nm apply
は、
指定されたコマンド
.Ar command
に、各引数
.Ar argument
を順番に与えて実行します。
.Pp
.Ar command
内に
.Dq Li \&%d
の形をした文字列があった場合には (ここで
.Dq Li d
は 1 から 9 までの数字)、これらは未使用の引数
.Ar argument
のうちの
.Li d
番目のものと置き換えられます。
このとき
.Ar command
の実行ごとに最大の
.Dq Li d
の数だけ引数は捨てられます。
.Pp
オプションは以下のものがあります:
.Bl -tag -width "-ac"
.It Fl Ns Ar #
通常は引数は一つしか渡されません。オプション
.Fl #
で
.Ar command
に渡される引数の個数を指定できます。
この数値が 0 のときは、引数なしで
.Ar command
が引数
.Ar argument
につき 1 回、実行されます。
.Pp
もしコマンド内に
.Dq Li \&%d
があった場合、
.Fl #
オプションは無視されます。
.It Fl a Ns Ar c
デフォルトではマジックキャラクタとして
.Dq Li %
を使っていますが、これは
.Fl a
オプションで変更ができます。
.El
.Sh 環境変数
以下の環境変数が
.Nm apply
の実行に影響します:
.Bl -tag -width SHELL
.It Ev SHELL
利用する shell のパス名です。
この変数が定義されていない場合は Bourne shell が使われます。
.El
.Sh 使用例
.Bl -tag -width apply -compact
.It Li "apply echo a*"
ls(1) に似た出力になります。
.It Li "apply \-2 cmp a1 b1 a2 b2 a3 b3"
`a' のファイルと `b' のファイルを比較します。
.It Li "apply \-0 who 1 2 3 4 5"
who(1) を 5 回実行します。
.It Li "apply \'ln %1 /usr/joe\'" *
カレントディレクトリ内の全てのファイルをディレクトリ
.Pa /usr/joe
にリンクします。
.El
.Sh 関連ファイル
.Bl -tag -width /bin/sh -compact
.It Pa /bin/sh
デフォルトの shell です。
.El
.Sh 作者
.An Rob Pike
.Sh バグ
.Ar command
内に shell のメタキャラクタを使用すると、異常な動作をするかもしれません。
複雑なコマンドはシングルクォート
.Pq Sq
で括るのがベストです。
.Sh 歴史
.Nm
コマンドは
.Bx 4.2
から登場しました。