aboutsummaryrefslogtreecommitdiff
path: root/readline/support/mkdirs
blob: b79d9716f464b54db8828aee413878154382d0bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh
#
# mkdirs - a work-alike for `mkdir -p'
#
# Chet Ramey
# chet@po.cwru.edu

for dir
do

	test -d "$dir" && continue

	tomake=$dir
	while test -n "$dir" ; do
		# dir=${dir%/*}
		# dir=`expr "$dir" ':' '\(/.*\)/[^/]*'`
		if dir=`expr "$dir" ':' '\(.*\)/[^/]*'`; then
			tomake="$dir $tomake"
		else
			dir=
		fi
	done

	for d in $tomake
	do
		test -d "$d" && continue
		echo mkdir "$d"
		mkdir "$d"
	done
done

exit 0