#!/bin/sh
#
# General replacement for mkdir -p
# for those systems that lack mkdir -p
#
for i in $@
do
    case "$i" in
        /*)     # Absolute path
            dir=""
            for j in `echo $i | sed -e 's/\//   /g'`
            do
                dir="$dir/$j"
                if [ ! -d $dir ]; then
                    mkdir $dir
                fi
            done
            ;;
        */*)    # relative path
            dir="."
            for j in `echo $i | sed -e 's/\//   /g'`
            do
                dir="$dir/$j"
                if [ ! -d $dir ]; then
                    mkdir $dir
                fi
            done
            ;;
        *)      # right here
            if [ ! -d $i ]; then
                mkdir $i
            fi
            ;;
    esac
done
exit 0

