summaryrefslogtreecommitdiff
path: root/support/mkdirs
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>1996-08-26 18:22:31 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:49 +0000
commit726f63884db0132f01745f1fb4465e6621088ccf (patch)
tree6c2f7765a890a97e0e513cb539df43283a8f7c4d /support/mkdirs
downloadbash-726f63884db0132f01745f1fb4465e6621088ccf.tar.gz
Imported from ../bash-1.14.7.tar.gz.
Diffstat (limited to 'support/mkdirs')
-rwxr-xr-xsupport/mkdirs29
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