3 # This is an actually-safe install command which installs the new
4 # file atomically in the new location, rather than overwriting
9 printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
17 while getopts Dlm
: name
; do
25 shift $
(($OPTIND - 1))
27 test "$#" -eq 2 || usage
33 */) printf "%s: %s ends in /\n", "$0" "$dst" 1>&2 ; exit 1 ;;
39 if test "$mkdirp" ; then
42 */*) mkdir
-p "${dst%/*}" ;;
46 trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
50 if test "$symlink" ; then
60 printf "%s: %s is a directory\n" "$0" "$dst" 1>&2