Unix and Linux Discussions Tagged with command |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
20,396 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
17,716 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,561 |
UNIX for Beginners Questions & Answers |
|
|
|
17 |
167,228 |
Shell Programming and Scripting |
|
|
|
2 |
16,108 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
64,483 |
Shell Programming and Scripting |
|
|
|
2 |
7,016 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
71,942 |
Shell Programming and Scripting |
|
|
|
3 |
69,587 |
Shell Programming and Scripting |
|
|
|
1 |
10,379 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
17,605 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
23,634 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
6,171 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
9,204 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
7,912 |
UNIX for Beginners Questions & Answers |
|
|
|
13 |
70,138 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,805 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
15,102 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
9,257 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
10,900 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
11,878 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
8,757 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
16,274 |
Shell Programming and Scripting |
|
|
|
2 |
14,722 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
7,812 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
7,580 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
7,477 |
Shell Programming and Scripting |
|
|
|
1 |
12,601 |
Shell Programming and Scripting |
|
|
|
6 |
21,971 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
24,726 |
Programming |
|
|
|
7 |
10,459 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
10,249 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
24,881 |
OS X (Apple) |
|
|
|
3 |
8,953 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
12,789 |
Shell Programming and Scripting |
|
|
|
2 |
17,922 |
Shell Programming and Scripting |
|
|
|
2 |
5,291 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,026 |
Shell Programming and Scripting |
|
|
|
3 |
6,607 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
16,468 |
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)