aboutsummaryrefslogtreecommitdiff
path: root/readline/support/mkdirs
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-04-16 01:34:55 +0000
committerStan Shebs <shebs@codesourcery.com>1999-04-16 01:34:55 +0000
commitd60d9f651ab04df95fcd31488fbb46be263382ae (patch)
treee3dca903583e6c52788d623f4d3f5f31e2726dd3 /readline/support/mkdirs
downloadgdb-d60d9f651ab04df95fcd31488fbb46be263382ae.zip
gdb-d60d9f651ab04df95fcd31488fbb46be263382ae.tar.gz
gdb-d60d9f651ab04df95fcd31488fbb46be263382ae.tar.bz2
Initial creation of sourceware repository
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 0000000..b79d971
--- /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