Files
wmaker/mkinstalldirs
T

41 lines
671 B
Bash
Raw Normal View History

1999-01-29 08:11:17 +00:00
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
1998-09-29 22:36:29 +00:00
1999-01-29 08:11:17 +00:00
# $Id$
1998-09-29 22:36:29 +00:00
errstatus=0
1999-01-29 08:11:17 +00:00
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
1998-09-29 22:36:29 +00:00
1999-01-29 08:11:17 +00:00
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
1998-09-29 22:36:29 +00:00
1999-01-29 08:11:17 +00:00
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
1998-09-29 22:36:29 +00:00
1999-01-29 08:11:17 +00:00
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
1998-09-29 22:36:29 +00:00
fi
1999-01-29 08:11:17 +00:00
pathcomp="$pathcomp/"
1998-09-29 22:36:29 +00:00
done
done
exit $errstatus
1999-01-29 08:11:17 +00:00
# mkinstalldirs ends here