Initial revision
authorroland <roland>
Sun, 16 May 1993 18:03:08 +0000 (18:03 +0000)
committerroland <roland>
Sun, 16 May 1993 18:03:08 +0000 (18:03 +0000)
mkinstalldirs [new file with mode: 0755]

diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755 (executable)
index 0000000..a87fe22
--- /dev/null
@@ -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