#!/bin/sh
# $Id: dir-tree,v 1.1 2002/01/14 07:49:17 shadow Exp $

#######################################################
#
# Make a directory tree of directories 
# dir-tree <depth> <dirnames>+
#
#######################################################

DEPTH=$1; shift
DIRNUMS="$*"
export DIRNUMS DEPTH

# catch non numeric args and recurse cond
expr $DEPTH '>' 0 > /dev/null 2>&1 || exit 0

for a in $DIRNUMS; do
    (mkdir $a && cd $a && \
      $SHELL $SHELLVERBOSE ${srcdir}/dir-tree \
	     `expr $DEPTH - 1` "$DIRNUMS") || exit 1
done
