Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ apply.bsd(1) — Domain/IX SR9.2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

APPLY(1)

NAME

apply − apply a command to a set of arguments

USAGE

apply [ −ac ] [ −n ] command args ... 

DESCRIPTION

Apply runs the named command on each argument arg in turn. 

OPTIONS

−n Specify n as the number of arguments to be passed to command.  (Normally, arguments are chosen individually.)  If n is zero, run command without arguments once for each arg.  Replace character sequences of the form %d in command, where d is a digit from 1 to 9, by the dth following the unused arg.  If any such sequences occur, ignore n, and make the number of arguments passed to command the maximum value of d in command. 

−ac Change the % character to the value of c.

EXAMPLES

To perform a comparison between the a and b files shown on the command line below, use the following:

apply −2 cmp a1 b1 a2

To run the who (1) command five times, type this:

apply −0 who 1 2 3

To link all files in the current directory to the directory /usr/joe, execute the following command:

apply ´ln %1 /usr/joe´ *

CAUTIONS

Shell metacharacters in command may have bizarre effects.  It is best to enclose complicated commands in single quotes. 

There is no way to pass a literal “%2” if “%” is the argument expansion character. 

RELATED INFORMATION

sh (1). 

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