Manual Page Result
0
Command: apply | Section: 1 | Source: UNIX v10 | File: apply.1
APPLY(1) General Commands Manual APPLY(1)
NAME
apply, pick - repeatedly apply a command; select arguments
SYNOPSIS
apply [ -ac ] [ -n ] command arg ...
pick [ arg ... ]
DESCRIPTION
Apply runs the named command on each argument arg in turn. Normally
arguments are chosen singly; the optional number n specifies the number
of arguments to be passed to command. If n is zero, command is run
without arguments once for each arg. Character sequences of the form
%d in command, where d is a digit from 1 to 9, are replaced by the dth
following unused arg. If any such sequences occur, n is ignored, and
the number of arguments passed to command is the maximum value of d in
command. The character may be changed by the -a option.
Pick writes each argument to the standard error and reads a reply. If
the reply is the argument is echoed to the standard output; if the re-
ply is pick exits without reading any more arguments; there is no out-
put for any other response. If there are no arguments, lines of the
standard input are taken instead.
EXAMPLES
apply echo *
Time-consuming way to do
apply -2 cmp a1 b1 a2 b2
Compare the `a' files to the `b' files.
wc -l `pick *.[ch]`
Interactively select `.c' and `.h' files and count the lines in
each.
apply "wc -l %1" `pick *.[ch]`
Same, but use a separate process to count each file.
SEE ALSO
sh(1)
BUGS
There is no way to pass a literal if is apply's argument expansion
character.
APPLY(1)