Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ apply(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh, Rsh

xargs



APPLY(1,C)                  AIX Commands Reference                   APPLY(1,C)



-------------------------------------------------------------------------------
apply



PURPOSE

Runs a named command on each argument, arg in turn.

SYNTAX


         +-------+   +------+
apply ---|       |---|      |--- command --- args ---|
         +- -ac -+   +- -n -+             ^        |
                                          +--------+


DESCRIPTION

The apply command 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 d'th 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.

FLAGS

-ac      Identifies the character c used instead of the '%'.

-n       Specifies the number of arguments to be passed to command.

EXAMPLES

  1. A use similar to ls:

      apply echo *

  2. To compare the 'a' files to the 'b' files:

      apply -2 cmp a1 b1 a2 b2 . . .

  3. To run who 5 times:

      apply -0 who 1 2 3 4 5

  4. To link all files in the current directory to the directory /usr/joe:

      apply 'ln %1 /usr/joe' *



Processed November 8, 1990        APPLY(1,C)                                  1





APPLY(1,C)                  AIX Commands Reference                   APPLY(1,C)




RELATED INFORMATION

See the following commands:  "sh, Rsh" and "xargs."



















































Processed November 8, 1990        APPLY(1,C)                                  2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026