diff options
Diffstat (limited to 'support/mkdirs')
-rwxr-xr-x | support/mkdirs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/support/mkdirs b/support/mkdirs new file mode 100755 index 0000000..52228d1 --- /dev/null +++ b/support/mkdirs @@ -0,0 +1,29 @@ +#! /bin/sh +# +# mkdirs - a work-alike for `mkdir -p' +# +# Chet Ramey +# chet@po.cwru.edu + +for dir +do + + [ -d "$dir" ] && continue + + tomake=$dir + while [ "$dir" ]; do + # dir=${dir%/*} + # dir=`expr "$dir" ':' '^\(/.*\)/[^/]*'` + dir=`expr "$dir" ':' '^\(.*\)/[^/]*'` + tomake="$dir $tomake" + done + + for d in $tomake + do + [ -d $d ] && continue + echo mkdir $d + mkdir $d + done +done + +exit 0 |