Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / byacc / dist / mkdirs.sh
blob84231d4c89111094c449e7ff253ecc72d3182364
1 #! /bin/sh
2 # Id: mkdirs.sh,v 1.3 2007/03/25 22:29:46 tom Exp
3 # -----------------------------------------------------------------------------
4 # mkinstalldirs --- make directory hierarchy
5 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
6 # Created: 1993-05-16
7 # Last modified: 1994-03-25
8 # Public domain
9 # -----------------------------------------------------------------------------
11 errstatus=0
12 umask 022
14 for file in ${1+"$@"} ; do
15 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
16 shift
18 pathcomp=
19 for d in ${1+"$@"} ; do
20 pathcomp="$pathcomp$d"
21 case "$pathcomp" in
22 -* ) pathcomp=./$pathcomp ;;
23 esac
25 if test ! -d "$pathcomp"; then
26 echo "mkdir $pathcomp" 1>&2
27 case "$pathcomp" in
28 [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
29 ;; # DOSISH systems
30 * )
31 mkdir "$pathcomp"
32 errstatus=$?
33 if test $errstatus != 0
34 then
35 # may have failed if invoked in a parallel "make -j# install"
36 if test -d "$pathcomp"
37 then
38 errstatus=0
42 esac
45 pathcomp="$pathcomp/"
46 done
47 done
49 exit $errstatus
51 # mkinstalldirs ends here