diff options
author | Greg McGary <greg@mcgary.org> | 1997-04-18 06:42:59 +0000 |
---|---|---|
committer | Greg McGary <greg@mcgary.org> | 1997-04-18 06:42:59 +0000 |
commit | 40b4b4e4990e67028efb79345fba5fa9e760b522 (patch) | |
tree | 34e9ba556c821f7c7f94b99c0cbcbf0cc321b5af /mkinstalldirs | |
parent | 8c13e09279f361e18173f9e237c454af0ab33299 (diff) | |
download | idutils-40b4b4e4990e67028efb79345fba5fa9e760b522.tar.gz idutils-40b4b4e4990e67028efb79345fba5fa9e760b522.tar.bz2 idutils-40b4b4e4990e67028efb79345fba5fa9e760b522.zip |
Initial revision
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-x | mkinstalldirs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..0801ec2 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,32 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Last modified: 1994-03-25 +# Public domain + +errstatus=0 + +for file in ${1+"$@"} ; do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d in ${1+"$@"} ; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" || errstatus=$? + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here |