BSD 4_4 release
[unix-history] / usr / src / usr.bin / apply / apply.1
index ff51a11..ec8d478 100644 (file)
@@ -1,10 +1,37 @@
-.\" Copyright (c) 1983, 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1983, 1990, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"     @(#)apply.1    6.3 (Berkeley) 7/24/90
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.Dd July 24, 1990
+.\"     @(#)apply.1    8.1 (Berkeley) 6/6/93
+.\"
+.Dd June 6, 1993
 .Dt APPLY 1
 .Os BSD 4.2
 .Sh NAME
 .Dt APPLY 1
 .Os BSD 4.2
 .Sh NAME
@@ -12,8 +39,8 @@
 .Nd apply a command to a set of arguments
 .Sh SYNOPSIS
 .Nm apply
 .Nd apply a command to a set of arguments
 .Sh SYNOPSIS
 .Nm apply
-.Op Fl ac
-.Op Fl n
+.Op Fl a Ns Ar c
+.Op Fl Ns Ar n
 .Ar command args ...
 .Sh DESCRIPTION
 .Nm Apply
 .Ar command args ...
 .Sh DESCRIPTION
 .Nm Apply
@@ -23,6 +50,10 @@ on each
 argument
 .Ar arg
 in turn.
 argument
 .Ar arg
 in turn.
+.Pp
+Options available are:
+.Bl -tag -width "-ac"
+.It Fl Ns Ar n
 Normally arguments are chosen singly; the optional number
 .Fl n
 specifies the number of arguments to be passed to
 Normally arguments are chosen singly; the optional number
 .Fl n
 specifies the number of arguments to be passed to
@@ -32,18 +63,16 @@ If
 is zero,
 .Ar command
 is run without arguments once for each
 is zero,
 .Ar command
 is run without arguments once for each
-.Ar arg
+.Ar arg .
 Character sequences of the form
 Character sequences of the form
-.Cx %
-.Ar d
-.Cx
+.Pf \&% Ar d
 in
 .Ar command ,
 where
 .Ar d
 is a digit from 1 to 9,
 are replaced by the
 in
 .Ar command ,
 where
 .Ar d
 is a digit from 1 to 9,
 are replaced by the
-.Ar d\'th
+.Ar d Ns \'th
 following unused
 .Ar arg .
 If any such sequences occur,
 following unused
 .Ar arg .
 If any such sequences occur,
@@ -55,40 +84,52 @@ is the maximum value of
 .Ar d
 in
 .Ar command .
 .Ar d
 in
 .Ar command .
-The character `%' may be changed by the
+.It Fl a Ns Ar c
+The character
+.Ql %
+may be changed by the
 .Fl a
 option.
 .Fl a
 option.
-.SH ENVIRONMENT
-.Nm apply
-checks the environment variable
-.Ev SHELL
-to find out which shell to use.
+.El
+.Sh ENVIRONMENT
+The following environment variable is used by
+.Nm apply :
+.Bl -tag -width SHELL
+.It Ev SHELL
+Pathname of shell to use. If this option is not defined,
+a default shell is used.
+.El
 .Sh EXAMPLES
 .Sh EXAMPLES
-.Ds
-.Tw apply \-2 cmp a1 b1 a2 b2 ...
-.Tp Li apply echo a*
+.Bl -tag -width apply -compact
+.It Li "apply echo a*"
 is similar to ls(1);
 is similar to ls(1);
-.Tp Li apply \-2 cmp a1 b1 a2 b2 ...
+.It Li "apply \-2 cmp a1 b1 a2 b2 ..."
 compares the `a' files to the `b' files;
 compares the `a' files to the `b' files;
-.Tp Li apply \-0 who 1 2 3 4 5
+.It Li "apply \-0 who 1 2 3 4 5"
 runs who(1) 5 times; and
 runs who(1) 5 times; and
-.Tp Li apply \(aaln %1 /usr/joe\(aa *
+.It Li "apply \'ln %1 /usr/joe\'" *
 links all files in the current directory to the directory
 .Pa /usr/joe .
 links all files in the current directory to the directory
 .Pa /usr/joe .
-.Tp
-.De
+.El
 .Sh SEE ALSO
 .Xr sh 1
 .Sh SEE ALSO
 .Xr sh 1
-.Sh HISTORY
-.Nm Apply
-appeared in 4.2BSD.
 .Sh AUTHOR
 Rob Pike
 .Sh BUGS
 Shell metacharacters in
 .Ar command
 may have bizarre effects; it is best to enclose complicated
 .Sh AUTHOR
 Rob Pike
 .Sh BUGS
 Shell metacharacters in
 .Ar command
 may have bizarre effects; it is best to enclose complicated
-commands in single quotes (\(aa\ \(aa).
+commands in single quotes
+.Pq Sq .
 .Pp
 .Pp
-There is no way to pass a literal `%2' if `%' is the
+There is no way to pass a literal
+.Ql %2
+if
+.Ql %
+is the
 argument expansion character.
 argument expansion character.
+.Sh HISTORY
+The
+.Nm
+command appeared in 
+.Bx 4.2 .