summaryrefslogtreecommitdiff
path: root/readline/support/mkdirs
diff options
context:
space:
mode:
Diffstat (limited to 'readline/support/mkdirs')
-rwxr-xr-xreadline/support/mkdirs32
1 files changed, 32 insertions, 0 deletions
diff --git a/readline/support/mkdirs b/readline/support/mkdirs
new file mode 100755
index 00000000000..b79d9716f46
--- /dev/null
+++ b/readline/support/mkdirs
@@ -0,0 +1,32 @@
+#! /bin/sh
+#
+# mkdirs - a work-alike for `mkdir -p'
+#
+# Chet Ramey
+# chet@po.cwru.edu
+
+for dir
+do
+
+ test -d "$dir" && continue
+
+ tomake=$dir
+ while test -n "$dir" ; do
+ # dir=${dir%/*}
+ # dir=`expr "$dir" ':' '\(/.*\)/[^/]*'`
+ if dir=`expr "$dir" ':' '\(.*\)/[^/]*'`; then
+ tomake="$dir $tomake"
+ else
+ dir=
+ fi
+ done
+
+ for d in $tomake
+ do
+ test -d "$d" && continue
+ echo mkdir "$d"
+ mkdir "$d"
+ done
+done
+
+exit 0