NetBSD/gnu/dist/cvs/mkinstalldirs

41 lines
730 B
Plaintext
Raw Normal View History

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