[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.10

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