comparison scripts/mkinstalldirs @ 2334:893481f3a763

[project @ 1996-07-19 02:42:08 by jwe] Initial revision
author jwe
date Fri, 19 Jul 1996 02:47:02 +0000
parents
children 6929a31e7624
comparison
equal deleted inserted replaced
2333:b1a56412c385 2334:893481f3a763
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: Wed Jan 25 09:35:21 1995
6 # Public domain
7
8 errstatus=0
9
10 dirmode=0755
11
12 for file in ${1+"$@"} ; do
13 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
14 shift
15
16 pathcomp=
17 for d in ${1+"$@"} ; do
18 pathcomp="$pathcomp$d"
19 case "$pathcomp" in
20 -* ) pathcomp=./$pathcomp ;;
21 esac
22
23 if test ! -d "$pathcomp"; then
24 echo "mkdir $pathcomp" 1>&2
25 mkdir "$pathcomp" || errstatus=$?
26 echo "chmod $dirmode $pathcomp" 1>&2
27 chmod $dirmode "$pathcomp" || errstatus=$?
28 fi
29
30 pathcomp="$pathcomp/"
31 done
32 done
33
34 exit $errstatus
35
36 # mkinstalldirs ends here