summaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-05-16 18:03:08 +0000
committerRoland McGrath <roland@gnu.org>1993-05-16 18:03:08 +0000
commitbdcc4f41d67e6938e6881ef270b1af634d9fbb19 (patch)
treee488a5a6a1f50e41ff2c3f28615123981d0338d9 /mkinstalldirs
parentabc3769d8c6705a690b12a12ec187661012875f0 (diff)
Initial revision
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-xmkinstalldirs32
1 files changed, 32 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000000..a87fe222f8
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Make directory hierarchy.
+# Written by Noah Friedman <friedman@prep.ai.mit.edu>
+# Public domain.
+
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+for file in ${1+"$@"} ; do
+ oIFS="${IFS}"; IFS='/'; set - ${file}; IFS="${oIFS}"
+ test ".${1}" = "." && shift
+
+ case "${file}" in
+ /* ) pathcomp='/' ;;
+ * ) pathcomp='' ;;
+ esac
+
+ while test $# -ne 0 ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if test ! -d "${pathcomp}"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "${pathcomp}"
+ fi
+
+ pathcomp="${pathcomp}/"
+ done
+done
+
+# eof