shell再帰呼び出し自己
#!/bin/sh
if test "$2" = ""; then
echo "Usage: $0 basedir depth"
exit 1
fi
if test "$2" = "0"; then
exit 0
fi
for i in a b c d e f ; do
path="$1/$i"
mkdir $path || exit 1
sh $0 $path `expr $2 - 1` # :)
done
#!/bin/sh
if test "$2" = ""; then
echo "Usage: $0 basedir depth"
exit 1
fi
if test "$2" = "0"; then
exit 0
fi
for i in a b c d e f ; do
path="$1/$i"
mkdir $path || exit 1
sh $0 $path `expr $2 - 1` # :)
done