3 # Installation script for Unices without a BSD style install (e.g. HP-UX).
5 # Written by Andrew M. Bishop
7 # This file Copyright 1995,96,97,98 Andrew M. Bishop
8 # It may be distributed under the GNU Public License, version 2, or
9 # any higher version. See section COPYING of the GNU Public license
10 # for conditions under which this file may be redistributed.
14 echo "A simple installation script"
15 echo "usage: install.sh [-c] -d dir"
16 echo " install.sh [-c] [-m mode] [-g group] [-o owner] file destination"
20 if [ $1 = "-c" ]; then
24 if [ $1 = "-d" ]; then
26 if [ "x$2" = "x" ]; then
27 echo "Directory not specified"
32 dirs=`echo $2 | sed 's%/% %g'`
35 [ -d $dir ] || mkdir
$dir
44 while [ ! $# = 0 ]; do
51 -*) echo "Unrecognised option $1"; exit 1;;
53 *) src
=$1; shift; dst
=$1;;
59 if [ "x$src" = "x" -o "x$dst" = "x" ]; then
60 echo "Source and destination not specified"
65 dst
=$dst/`basename $src`
69 [ $mode ] && chmod $mode $dst
70 [ $group ] && chgrp
$group $dst
71 [ $owner ] && chown
$owner $dst
73 echo Copy of
$src to
$dst failed