2 # mkinstalldirs --- make directory hierarchy
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
7 # $Id: mkinstalldirs,v 1.1.1.1 2001/11/14 19:47:46 tv Exp $
13 Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
15 # process command line arguments
16 while test $# -gt 0 ; do
18 -h |
--help |
--h* ) # -h for help
19 echo "${usage}" 1>&2; exit 0 ;;
22 test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
25 -- ) shift; break ;; # stop option processing
26 -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
27 * ) break ;; # first non-opt arg
33 set fnord
`echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
39 pathcomp
="$pathcomp$d"
41 -* ) pathcomp
=.
/$pathcomp ;;
44 if test ! -d "$pathcomp"; then
45 echo "mkdir $pathcomp"
47 mkdir
"$pathcomp" || lasterr
=$?
49 if test ! -d "$pathcomp"; then
52 if test ! -z "$dirmode"; then
53 echo "chmod $dirmode $pathcomp"
56 chmod $dirmode "$pathcomp" || lasterr
=$?
58 if test ! -z "$lasterr"; then