root/juggler/branches/2.0_alpha_4/Doozer++/scripts/mkinstalldirs

Revision 14688, 0.7 kB (checked in by patrickh, 5 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
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
6
7 # $Orig: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $
8
9 umask 022
10
11 errstatus=0
12
13 for file
14 do
15    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
16    shift
17
18    pathcomp=
19    for d
20    do
21      pathcomp="$pathcomp$d"
22      case "$pathcomp" in
23        -* ) pathcomp=./$pathcomp ;;
24      esac
25
26      if test ! -d "$pathcomp"; then
27         echo "mkdir $pathcomp" 1>&2
28
29         mkdir "$pathcomp" || lasterr=$?
30
31         if test ! -d "$pathcomp"; then
32           errstatus=$lasterr
33         fi
34      fi
35
36      pathcomp="$pathcomp/"
37    done
38 done
39
40 exit $errstatus
41
42 # mkinstalldirs ends here
Note: See TracBrowser for help on using the browser.