diff options
author | Jari Aalto <jari.aalto@cante.net> | 1996-08-26 18:22:31 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:49 +0000 |
commit | 726f63884db0132f01745f1fb4465e6621088ccf (patch) | |
tree | 6c2f7765a890a97e0e513cb539df43283a8f7c4d /support/mkdirs | |
download | bash-726f63884db0132f01745f1fb4465e6621088ccf.tar.gz |
Imported from ../bash-1.14.7.tar.gz.
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 00000000..52228d1e --- /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 |