Unix and Linux Discussions Tagged with command |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
20,711 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
18,044 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,708 |
UNIX for Beginners Questions & Answers |
|
|
|
17 |
168,239 |
Shell Programming and Scripting |
|
|
|
2 |
16,330 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
64,929 |
Shell Programming and Scripting |
|
|
|
2 |
7,182 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
72,448 |
Shell Programming and Scripting |
|
|
|
3 |
69,838 |
Shell Programming and Scripting |
|
|
|
1 |
10,556 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
18,035 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
24,056 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
6,312 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
9,400 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
8,101 |
UNIX for Beginners Questions & Answers |
|
|
|
13 |
70,609 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,933 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
15,492 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
9,433 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
11,142 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
12,080 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
8,929 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
16,333 |
Shell Programming and Scripting |
|
|
|
2 |
15,021 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
7,967 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
7,810 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
7,512 |
Shell Programming and Scripting |
|
|
|
1 |
12,636 |
Shell Programming and Scripting |
|
|
|
6 |
22,223 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
25,081 |
Programming |
|
|
|
7 |
10,708 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
10,451 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
25,081 |
OS X (Apple) |
|
|
|
3 |
9,127 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
12,836 |
Shell Programming and Scripting |
|
|
|
2 |
18,015 |
Shell Programming and Scripting |
|
|
|
2 |
5,404 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,082 |
Shell Programming and Scripting |
|
|
|
3 |
6,772 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
16,614 |
UNIX for Advanced & Expert Users |
apply(1) General Commands Manual apply(1)
NAME
apply - Applies a command to a set of arguments
SYNOPSIS
apply [-acharacter] [-number] command argument...
The apply command runs the specified command on each argument in turn.
OPTIONS
Identifies the character used instead of the % (percent sign) to designate argument substitution strings. Specifies the number of argu-
ments to be passed to command.
DESCRIPTION
Normally, arguments are chosen individually; the optional number specifies the number of arguments to be passed to command. If number is 0
(zero), command is run without arguments once for each argument.
If you include character sequences of the form %n (where n is a digit from 1 to 9) in command, they are replaced by the nth unused argument
following command when command is executed. If any such sequences occur, number is ignored, and the number of arguments passed to command
is the maximum value of n in command.
You can specify a character other than % (percent sign) to designate argument substitution character strings with the -a option; for exam-
ple, -a@ would indicate that the sequences @1 and @2 were to be replaced by the first and second unused arguments following command.
NOTES
Shell metacharacters in command may have undesirable effects; it is best to enclose complicated commands in ' ' (single quotes).
There is no way to pass a % (percent sign) followed immediately by any number if % is the argument expansion character.
EXAMPLES
The following command is similar to ls: apply echo * The following command compares the file a1 to the file b1, a2 to b2, and so on: apply
-2 cmp a1 b1 a2 b2 ... The following command runs who 5 times: apply -0 who 1 2 3 4 5 The following command links all files in the current
directory to the directory /usr/joe: apply 'ln %1 /usr/joe' *
SEE ALSO
Commands: sh(1), xargs(1)
apply(1)