projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
739535e1189b000b73def2073c5daed05ac687d1
[ghc-hetmet.git]
/
glafp-utils
/
scripts
/
mkdirhier.sh
1
#!/bin/sh
2
3
#
4
# create a heirarchy of directories
5
#
6
7
for f in $*; do
8
parts=`echo $f | sed 's,\(.\)/\(.\),\1 \2,g' | sed 's,/$,,'`;
9
path="";
10
for p in $parts; do
11
if [ x"$path" = x ]; then
12
dir=$p;
13
else
14
dir=$path/$p;
15
fi;
16
if [ ! -d $dir ]; then
17
echo mkdir $dir;
18
mkdir $dir;
19
chmod a+rx $dir;
20
fi;
21
path=$dir;
22
done;
23
done
24