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

Annotation of src/usr.bin/xinstall/install.1, Revision 1.7

1.7     ! aaron       1: .\"    $OpenBSD: install.1,v 1.6 1998/10/30 00:24:44 aaron Exp $
1.1       deraadt     2: .\"    $NetBSD: install.1,v 1.4 1994/11/14 04:57:17 jtc Exp $
                      3: .\"
                      4: .\" Copyright (c) 1987, 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: .\"     @(#)install.1  8.1 (Berkeley) 6/6/93
                     36: .\"
                     37: .Dd June 6, 1993
                     38: .Dt INSTALL 1
                     39: .Os BSD 4.2
                     40: .Sh NAME
                     41: .Nm install
                     42: .Nd install binaries
                     43: .Sh SYNOPSIS
                     44: .Nm install
1.3       millert    45: .Op Fl CcpSs
1.1       deraadt    46: .Op Fl f Ar flags
                     47: .Op Fl g Ar group
                     48: .Op Fl m Ar mode
                     49: .Op Fl o Ar owner
                     50: .Ar file1 file2
                     51: .Nm install
1.3       millert    52: .Op Fl CcpSs
1.1       deraadt    53: .Op Fl f Ar flags
                     54: .Op Fl g Ar group
                     55: .Op Fl m Ar mode
                     56: .Op Fl o Ar owner
                     57: .Ar file1
                     58: \&...
                     59: .Ar fileN directory
                     60: .Nm install
                     61: .Fl d
1.4       millert    62: .Op Fl g Ar group
1.1       deraadt    63: .Op Fl m Ar mode
                     64: .Op Fl o Ar owner
                     65: .Ar directory
                     66: \&...
                     67: .Sh DESCRIPTION
                     68: The file(s) are moved (or copied if the
                     69: .Fl c
                     70: option is specified) to the target file or directory.
                     71: If the destination is a directory, then the
                     72: .Ar file
                     73: is moved into
                     74: .Ar directory
                     75: with its original filename.
                     76: If the target file already exists, it is overwritten if permissions
                     77: allow.
                     78: .Bl -tag -width Ds
1.3       millert    79: .It Fl C
                     80: Copy the file.
                     81: If the target file already exists and the files are the same,
                     82: then don't change the modification time of the target.
1.1       deraadt    83: .It Fl c
1.3       millert    84: Copy the file.  This is actually the default.  The
                     85: .Fl c
                     86: option is only included for backwards compatibility.
                     87: .It Fl d
                     88: Create directories.
                     89: Missing parent directories are created as required.
1.1       deraadt    90: .It Fl f
                     91: Specify the target's file flags.
                     92: (See
                     93: .Xr chflags 1
                     94: for a list of possible flags and their meanings.)
                     95: .It Fl g
1.3       millert    96: Specify a group.  A numeric GID is allowed.
1.1       deraadt    97: .It Fl m
                     98: Specify an alternate mode.
                     99: The default mode is set to rwxr-xr-x (0755).
                    100: The specified mode may be either an octal or symbolic value; see
                    101: .Xr chmod  1
                    102: for a description of possible mode values.
                    103: .It Fl o
1.3       millert   104: Specify an owner.  A numeric UID is allowed.
                    105: .It Fl p
                    106: Preserve the modification time.
                    107: Copy the file, as if the
                    108: .Fl C
1.6       aaron     109: (compare and copy) option is specified,
1.3       millert   110: except if the target file doesn't already exist or is different,
                    111: then preserve the modification time of the file.
                    112: .It Fl S
                    113: Safe copy.  Normally,
                    114: .Nm install
                    115: unlinks an existing target before installing the new file.  With the
                    116: .Fl S
                    117: flag a temporary file is used and then renamed to be
                    118: the target.  The reason this is safer is that if the copy or
                    119: rename fails, the existing target is left untouched.
1.1       deraadt   120: .It Fl s
1.6       aaron     121: .Nm install
1.1       deraadt   122: exec's the command
1.5       millert   123: .Pa /usr/bin/strip
1.1       deraadt   124: to strip binaries so that install can be portable over a large
1.5       millert   125: number of systems and binary types.  If the environment variable
                    126: .Ev STRIP
                    127: is set, it is used instead.
1.1       deraadt   128: .El
                    129: .Pp
                    130: By default,
                    131: .Nm install
                    132: preserves all file flags, with the exception of the ``nodump'' flag.
                    133: .Pp
                    134: The
                    135: .Nm install
                    136: utility attempts to prevent moving a file onto itself.
                    137: .Pp
                    138: Installing
                    139: .Pa /dev/null
                    140: creates an empty file.
                    141: .Pp
                    142: Upon successful completion a value of 0 is returned.
                    143: Otherwise, a value of 1 is returned.
1.3       millert   144: .Sh FILES
                    145: .Bl -tag -width INS@XXXXXX -compact
                    146: .It Pa INS@XXXXXX
                    147: If either
                    148: .Fl S
                    149: option is specified, or the
                    150: .Fl C
                    151: or
                    152: .Fl p
                    153: option is used in conjuction with the
                    154: .Fl s
                    155: option, temporary files named INS@XXXXXX,
                    156: where XXXXXX is decided by
                    157: .Xr mkstemp 3 ,
                    158: are created in the target directory.
1.5       millert   159: .Sh ENVIRONMENT
                    160: .Nm
                    161: utilizes the following environment variables.
                    162: .Bl -tag -width "STRIP"
                    163: .It Ev STRIP
                    164: For an alternate
                    165: .Xr strip 1
                    166: program to run.  Default is
                    167: .Pa /usr/bin/strip .
1.1       deraadt   168: .Sh SEE ALSO
                    169: .Xr chflags 1 ,
                    170: .Xr chgrp 1 ,
                    171: .Xr chmod 1 ,
                    172: .Xr cp 1 ,
                    173: .Xr mv 1 ,
                    174: .Xr strip 1 ,
                    175: .Xr chown 8
                    176: .Sh HISTORY
                    177: The
                    178: .Nm install
                    179: utility appeared in
                    180: .Bx 4.2 .
1.3       millert   181: .Sh CAVEATS
                    182: The
                    183: .Fl C ,
                    184: .Fl p ,
                    185: and
                    186: .Fl S
                    187: flags are non-standard and should not relied upon for portability.
1.6       aaron     188: .Pp
1.3       millert   189: Temporary files may be left in the target directory if
                    190: .Nm install
                    191: exits abnormally.