home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- #
- # Validate arguments
- #
- if [ $# != 1 ]
- then
- echo "usage: $0 dirname" >&2
- exit 1
- fi
-
- #
- # If this isn't an absolute path, initialize the directory path to the
- # current directory.
- #
- case $1 in
- /*) dirpath=""
- ;;
- *) dirpath="."
- ;;
- esac
-
- #
- # Loop through building non-existant directories.
- #
- for dir in `echo $1 | sed -e 's@/@ @g'`
- do
- dirpath="$dirpath/$dir"
- if [ ! -x $dirpath ]
- then
- echo "Making directory $dirpath"
- mkdir $dirpath || exit 1
- chmod 755 $dirpath || exit 1
- fi
- done
-