#!/bin/sh
#
# # Copyright (C) 1989,1990,1991,1992 by
#	Wilfried Koch, Andreas Lampen, Axel Mahler, Juergen Nickelsen,
#	Wolfgang Obst and Ulrich Pralle 
# 
# This file is part of shapeTools.
#
# This software is published in the hope that it will be useful, but
# WITHOUT ANY WARRANTY for any part of this software to work correctly
# or as described in the manuals. See the ShapeTools Public License
# for details.
#
# Permission is granted to use, copy, modify, or distribute any part of
# this software but only under the conditions described in the ShapeTools 
# Public License. A copy of this license is supposed to have been given
# to you along with shapeTools in a file named LICENSE. Among other
# things, this copyright notice and the Public License must be
# preserved on all copies.

#
# $Header: mkpdir[1.2] Fri Feb 14 18:26:38 1992 andy@cs.tu-berlin.de accessed $

notdir='File exists'
progname=`basename $0`

if [ $# != 1 ]
then
	echo usage: $progname directory 1>&2
	exit 2
fi

for i in `echo $1 | sed 's|\(.\)/|\1 |g'`
do
	if [ -f $i ]
	then
		echo $progname: $notdir 1>&2
		exit 1
	elif [ ! -d $i ]
	then
		mkdir $i || exit 3
	fi
	chmod 775 $i 2> /dev/null
	cd $i
done
