blob: c6261f42e8e50a8cc90b8c45f459844076628215 (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/bin/sh
#
# create a hierarchy of directories
#
# Based on Noah Friedman's mkinstalldirs..
#
quiet=no
errs=0
if [ "$1" = "-q" ]
then
shift
quiet=yes
fi
for f in $*; do
parts=`echo ":$f" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
path="";
for p in $parts; do
path="$path$p"
case "$path" in
-* ) path=./$path ;;
esac
if test ! -d "$path"; then
if [ "$quiet" = "no" ]
then
echo "mkdir $path" 1>&2
fi
mkdir "$path" || lasterr=$?
if test ! -d "$path"; then
errs=$lasterr
fi
fi
path="$path/";
done;
done
exit $errs
# end of story
|