.
[glibc/history.git] / scripts / mkinstalldirs
blobf945dbf2bcef821a53120501b0a06fc0388a2d5c
1 #! /bin/sh
2 # mkinstalldirs --- make directory hierarchy
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
4 # Created: 1993-05-16
5 # Public domain
7 errstatus=0
9 for file
11 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
12 shift
14 pathcomp=
15 for d
17 pathcomp="$pathcomp$d"
18 case "$pathcomp" in
19 -* ) pathcomp=./$pathcomp ;;
20 esac
22 if test ! -d "$pathcomp"; then
23 echo "mkdir $pathcomp" 1>&2
25 mkdir "$pathcomp" || lasterr=$?
27 if test ! -d "$pathcomp"; then
28 errstatus=$lasterr
32 pathcomp="$pathcomp/"
33 done
34 done
36 exit $errstatus
38 # mkinstalldirs ends here