Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / tests / dir-tree
1 #!/bin/sh
2 # $Id$
3
4 #######################################################
5 #
6 # Make a directory tree of directories
7 # dir-tree <depth> <dirnames>+
8 #
9 #######################################################
10
11 DEPTH=$1; shift
12 DIRNUMS="$*"
13 export DIRNUMS DEPTH
14
15 # catch non numeric args and recurse cond
16 expr $DEPTH '>' 0 > /dev/null 2>&1 || exit 0
17
18 for a in $DIRNUMS; do
19 (mkdir $a && cd $a && \
20 $SHELL $SHELLVERBOSE ${srcdir}/dir-tree \
21 `expr $DEPTH - 1` "$DIRNUMS") || exit 1
22 done