os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/install-sh
First public contribution.
4 # install - install a program, script, or datafile
5 # This comes from X11R5; it is not part of GNU.
7 # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
9 # This script is compatible with the BSD install script, but was written
14 # set DOITPROG to echo to test this script
16 # Don't use :- since 4.3BSD and earlier shells don't like it.
20 # put in absolute paths if you don't have them in your path; or use env. vars.
24 chmodprog="${CHMODPROG-chmod}"
25 chownprog="${CHOWNPROG-chown}"
26 chgrpprog="${CHGRPPROG-chgrp}"
27 stripprog="${STRIPPROG-strip}"
40 while [ x"$1" != x ]; do
46 -m) chmodcmd="$chmodprog $2"
51 -o) chowncmd="$chownprog $2"
56 -g) chgrpcmd="$chgrpprog $2"
61 -s) stripcmd="$stripprog"
65 -S) stripcmd="$stripprog $2"
83 echo "install: no input file specified"
89 echo "install: no destination specified"
94 # If destination is a directory, append the input filename; if your system
95 # does not like double slashes in filenames, you may need to add some logic
99 dst="$dst"/`basename $src`
102 # Make a temp file name in the proper directory.
104 dstdir=`dirname $dst`
105 dsttmp=$dstdir/#inst.$$#
107 # Move or copy the file name to the temp name
109 $doit $instcmd $src $dsttmp
111 # and set any options; do chmod last to preserve setuid bits
113 if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
114 if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
115 if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
116 if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
118 # Now rename the file to the real destination.
121 $doit $mvcmd $dsttmp $dst