1#!/bin/sh
2# Courtesy of Paul Eggert
3
4newline='
5'
6IFS=$newline
7
8case ${1--} in
9-*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1
10esac
11
12status=
13
14for directory
15do
16	case $directory in
17	'')
18		echo >&2 "mkdirhier: empty directory name"
19		status=1
20		continue;;
21	*"$newline"*)
22		echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''"
23		status=1
24		continue;;
25	-*) prefix=./;;
26	*) prefix=
27	esac
28
29	mkdir -p $prefix$directory || status=$?
30
31  done
32
33exit $status
34