mdbtools/mkinstalldirs

41 lines
724 B
Plaintext
Raw Normal View History

2001-04-12 07:53:50 +08:00
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
2001-04-16 07:55:44 +08:00
# $Id: mkinstalldirs,v 1.1 2001/04/16 00:00:29 brianb Exp $
2001-04-12 07:53:50 +08:00
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
2001-04-16 07:55:44 +08:00
echo "mkdir $pathcomp"
2001-04-12 07:53:50 +08:00
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here