1APPLY(1)                    General Commands Manual                   APPLY(1)
2
3
4

NAME

6       apply - apply a command to a set of arguments
7

SYNOPSIS

9       apply [ -ac ] [ -n ] command args ...
10

DESCRIPTION

12       Apply  runs  the  named command on each argument arg in turn.  Normally
13       arguments are chosen singly; the optional number n specifies the number
14       of  arguments  to  be  passed to command.  If n is zero, command is run
15       without arguments once for each arg.  Character sequences of  the  form
16       %d in command, where d is a digit from 1 to 9, are replaced by the d'th
17       following unused arg.  If any such sequences occur, n is  ignored,  and
18       the  number of arguments passed to command is the maximum value of d in
19       command.  The character `%' may be changed by the -a option.
20
21       Examples:
22              apply echo *
23       is similar to ls(1);
24              apply -2 cmp a1 b1 a2 b2 ...
25       compares the `a' files to the `b' files;
26              apply -0 who 1 2 3 4 5
27       runs who(1) 5 times; and
28              apply ´ln %1 /usr/joe´ *
29       links all files in the current directory to the directory /usr/joe.
30

SEE ALSO

32       sh(1)
33

AUTHOR

35       Rob Pike
36

BUGS

38       Shell metacharacters in command may have bizarre effects; it is best to
39       enclose complicated commands in single quotes ´ ´.
40
41       There is no way to pass a literal `%2' if `%' is the argument expansion
42       character.
43
44
45
464.2 Berkeley Distribution       April 29, 1985                        APPLY(1)
Impressum