[BACK]Return to apply.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / apply

Annotation of src/usr.bin/apply/apply.1, Revision 1.13

1.13    ! aaron       1: .\"    $OpenBSD: apply.1,v 1.12 2000/11/09 17:52:01 aaron Exp $
1.2       deraadt     2: .\"    $NetBSD: apply.1,v 1.4 1996/03/18 23:16:57 jtc Exp $
1.1       deraadt     3: .\"
                      4: .\" Copyright (c) 1983, 1990, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
                     15: .\" 3. All advertising materials mentioning features or use of this software
                     16: .\"    must display the following acknowledgement:
                     17: .\"    This product includes software developed by the University of
                     18: .\"    California, Berkeley and its contributors.
                     19: .\" 4. Neither the name of the University nor the names of its contributors
                     20: .\"    may be used to endorse or promote products derived from this software
                     21: .\"    without specific prior written permission.
                     22: .\"
                     23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     26: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     33: .\" SUCH DAMAGE.
                     34: .\"
                     35: .\"     @(#)apply.1    8.2 (Berkeley) 4/4/94
                     36: .\"
                     37: .Dd April 4, 1994
                     38: .Dt APPLY 1
1.8       aaron      39: .Os
1.1       deraadt    40: .Sh NAME
                     41: .Nm apply
                     42: .Nd apply a command to a set of arguments
                     43: .Sh SYNOPSIS
                     44: .Nm apply
                     45: .Op Fl a Ns Ar c
                     46: .Op Fl Ns Ar #
1.10      aaron      47: .Op Fl d
1.7       aaron      48: .Ar command argument
                     49: .Op Ar ...
1.1       deraadt    50: .Sh DESCRIPTION
1.9       aaron      51: .Nm
1.1       deraadt    52: runs the named
                     53: .Ar command
1.10      aaron      54: on each given
1.1       deraadt    55: .Ar argument
                     56: in turn.
                     57: .Pp
                     58: Character sequences of the form
                     59: .Dq Li \&%d
                     60: in
                     61: .Ar command ,
                     62: where
1.10      aaron      63: .Sq d
1.1       deraadt    64: is a digit from 1 to 9, are replaced by the
                     65: .Li d Ns \'th
                     66: following unused
                     67: .Ar argument .
                     68: In this case, the largest digit number of arguments are discarded for
                     69: each execution of
                     70: .Ar command .
                     71: .Pp
                     72: The options are as follows:
1.12      aaron      73: .Bl -tag -width Ds
1.1       deraadt    74: .It Fl Ns Ar #
                     75: Normally arguments are taken singly; the optional number
1.11      aaron      76: .Fl Ns Ar #
1.1       deraadt    77: specifies the number of arguments to be passed to
                     78: .Ar command .
                     79: If the number is zero,
                     80: .Ar command
                     81: is run, without arguments, once for each
                     82: .Ar argument .
                     83: .Pp
                     84: If any sequences of
                     85: .Dq Li \&%d
1.7       aaron      86: occur in
                     87: .Ar command ,
                     88: the
1.11      aaron      89: .Fl Ns Ar #
1.1       deraadt    90: option is ignored.
                     91: .It Fl a Ns Ar c
1.11      aaron      92: Use
                     93: .Ar c
                     94: as the magic character instead of the default
                     95: .Ql % .
1.10      aaron      96: .It Fl d
                     97: Debug mode.
                     98: Print commands to the standard output but do not actually execute them.
1.1       deraadt    99: .El
                    100: .Sh EXAMPLES
1.11      aaron     101: .Bl -tag -width apply
1.1       deraadt   102: .It Li "apply echo a*"
1.5       deraadt   103: is similar to
                    104: .Xr ls 1 ;
1.1       deraadt   105: .It Li "apply \-2 cmp a1 b1 a2 b2 a3 b3"
1.10      aaron     106: compares the
                    107: .Sq a
                    108: files to the
1.11      aaron     109: .Sq b
                    110: files;
1.1       deraadt   111: .It Li "apply \-0 who 1 2 3 4 5"
1.5       deraadt   112: runs
                    113: .Xr who 1
                    114: 5 times; and
1.1       deraadt   115: .It Li "apply \'ln %1 /usr/joe\'" *
                    116: links all files in the current directory to the directory
                    117: .Pa /usr/joe .
                    118: .El
1.13    ! aaron     119: .Sh ENVIRONMENT
        !           120: The following environment variable affects the execution of
        !           121: .Nm apply :
        !           122: .Bl -tag -width SHELL
        !           123: .It Ev SHELL
        !           124: Pathname of shell to use.
        !           125: If this variable is not defined, the Bourne shell is used.
        !           126: .El
1.7       aaron     127: .Sh FILES
1.1       deraadt   128: .Bl -tag -width /bin/sh -compact
                    129: .It Pa /bin/sh
1.7       aaron     130: default shell
1.1       deraadt   131: .El
1.10      aaron     132: .Sh SEE ALSO
                    133: .Xr xargs 1
1.1       deraadt   134: .Sh AUTHOR
                    135: Rob Pike
1.13    ! aaron     136: .Sh HISTORY
        !           137: The
        !           138: .Nm
        !           139: command appeared in
        !           140: .Bx 4.2 .
1.1       deraadt   141: .Sh BUGS
                    142: Shell metacharacters in
                    143: .Ar command
                    144: may have bizarre effects; it is best to enclose complicated
                    145: commands in single quotes
1.4       deraadt   146: .Pq '' .