ncursesw-morphos/mkinstalldirs

38 lines
777 B
Plaintext
Raw Normal View History

1998-03-01 12:21:12 +08:00
#! /bin/sh
1997-05-15 12:00:00 +08:00
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Last modified: 1994-03-25
# Public domain
2000-07-09 10:46:08 +08:00
#
1997-05-15 12:00:00 +08:00
errstatus=0
2000-07-09 10:46:08 +08:00
umask 022
1997-05-15 12:00:00 +08:00
2000-07-09 10:46:08 +08:00
for file in ${1+"$@"} ; do
1997-05-15 12:00:00 +08:00
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
2000-07-09 10:46:08 +08:00
case "$pathcomp" in
[a-zA-Z]: ) ;; # DOSISH systems
* ) mkdir "$pathcomp" || errstatus=$? ;;
esac
1997-05-15 12:00:00 +08:00
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here