head	1.1;
access;
symbols
	RELENG_8_4:1.1.0.18
	RELENG_9_1_0_RELEASE:1.1
	RELENG_9_1:1.1.0.16
	RELENG_9_1_BP:1.1
	RELENG_8_3_0_RELEASE:1.1
	RELENG_8_3:1.1.0.14
	RELENG_8_3_BP:1.1
	RELENG_9_0_0_RELEASE:1.1
	RELENG_9_0:1.1.0.12
	RELENG_9_0_BP:1.1
	RELENG_9:1.1.0.10
	RELENG_9_BP:1.1
	RELENG_8_2_0_RELEASE:1.1
	RELENG_8_2:1.1.0.8
	RELENG_8_2_BP:1.1
	RELENG_8_1_0_RELEASE:1.1
	RELENG_8_1:1.1.0.6
	RELENG_8_1_BP:1.1
	RELENG_8_0_0_RELEASE:1.1
	RELENG_8_0:1.1.0.4
	RELENG_8_0_BP:1.1
	RELENG_8:1.1.0.2
	RELENG_8_BP:1.1;
locks; strict;
comment	@# @;


1.1
date	2009.03.10.11.46.41;	author rwatson;	state Exp;
branches
	1.1.18.1;
next	;

1.1.18.1
date	2009.03.10.11.46.41;	author svnexp;	state dead;
branches;
next	1.1.18.2;

1.1.18.2
date	2013.03.28.13.02.09;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@SVN rev 189618 on 2009-03-10 11:46:41Z by rwatson

Merge r183430 from vendor/top/dist to head/contrib/top, although with
record-only mergeinfo because an automated merge is confused by the
flattening that took place:

  Move install to install-sh to prevent name-clashes.

MFC after:	3 days
@
text
@#!/bin/sh
#
# this shell script is amazingly similar to the old and lamented
# BSD "install" command.  It recognized the following options:
#
#	-o target file owner
#	-m target file mode
#	-g target file group owner
#
#
# scan the options
#
while [ $# -gt 0 ]; do
    case $1 in
      -o)
	owner=$2
	shift ; shift
	;;

      -m)
	mode=$2
	shift; shift
	;;

      -g)
	group=$2
	shift ; shift
	;;

      -*)
	echo "install: unknown option $1"
	exit
	;;

      *)
	break
	;;
    esac
done
#
# we need two more:  filename and destination
#
if [ $# -ne 2 ]; then
    echo "Usage:  install [ -o owner ] [ -m mode ] [ -g group ] file destination"
    exit
fi
#
# first, copy
#
cp $1 $2
#
# normalize the name
#
dest=$2
if [ -d $2 ]; then
    dest=$2/`basename $1`
fi
#
# do optional things
#
if [ "$owner" ]; then
    chown $owner $dest
fi
if [ "$group" ]; then
    chgrp $group $dest
fi
if [ "$mode" ]; then
    chmod $mode $dest
fi
@


1.1.18.1
log
@file install-sh was added on branch RELENG_8_4 on 2013-03-28 13:02:09 +0000
@
text
@d1 69
@


1.1.18.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 69
#!/bin/sh
#
# this shell script is amazingly similar to the old and lamented
# BSD "install" command.  It recognized the following options:
#
#	-o target file owner
#	-m target file mode
#	-g target file group owner
#
#
# scan the options
#
while [ $# -gt 0 ]; do
    case $1 in
      -o)
	owner=$2
	shift ; shift
	;;

      -m)
	mode=$2
	shift; shift
	;;

      -g)
	group=$2
	shift ; shift
	;;

      -*)
	echo "install: unknown option $1"
	exit
	;;

      *)
	break
	;;
    esac
done
#
# we need two more:  filename and destination
#
if [ $# -ne 2 ]; then
    echo "Usage:  install [ -o owner ] [ -m mode ] [ -g group ] file destination"
    exit
fi
#
# first, copy
#
cp $1 $2
#
# normalize the name
#
dest=$2
if [ -d $2 ]; then
    dest=$2/`basename $1`
fi
#
# do optional things
#
if [ "$owner" ]; then
    chown $owner $dest
fi
if [ "$group" ]; then
    chgrp $group $dest
fi
if [ "$mode" ]; then
    chmod $mode $dest
fi
@


