mkinstalldirs 650 B

123456789101112131415161718192021222324252627282930313233
  1. #! /bin/sh
  2. # mkinstalldirs --- make directory hierarchy
  3. # Author: Noah Friedman <friedman@prep.ai.mit.edu>
  4. # Created: 1993-05-16
  5. # Last modified: 1994-03-25
  6. # Public domain
  7. errstatus=0
  8. for file in ${1+"$@"} ; do
  9. set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
  10. shift
  11. pathcomp=
  12. for d in ${1+"$@"} ; do
  13. pathcomp="$pathcomp$d"
  14. case "$pathcomp" in
  15. -* ) pathcomp=./$pathcomp ;;
  16. esac
  17. if test ! -d "$pathcomp"; then
  18. echo "mkdir $pathcomp" 1>&2
  19. mkdir "$pathcomp" || errstatus=$?
  20. fi
  21. pathcomp="$pathcomp/"
  22. done
  23. done
  24. exit $errstatus
  25. # mkinstalldirs ends here