source: trunk/third/perl/makedir.SH @ 10724

Revision 10724, 1.2 KB checked in by ghudson, 27 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r10723, which included commits to RCS files with non-trunk default branches.
Line 
1case $CONFIG in
2'')
3    if test ! -f config.sh; then
4        ln ../config.sh . || \
5        ln ../../config.sh . || \
6        ln ../../../config.sh . || \
7        (echo "Can't find config.sh."; exit 1)
8    fi 2>/dev/null
9    . ./config.sh
10    ;;
11esac
12case "$0" in
13*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
14esac
15echo "Extracting makedir (with variable substitutions)"
16rm -f makedir
17$spitshell >makedir <<!GROK!THIS!
18$startsh
19# makedir.SH
20#
21
22export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
23
24case \$# in
25  0)
26    $echo "makedir pathname filenameflag"
27    exit 1
28    ;;
29esac
30
31: guarantee one slash before 1st component
32case \$1 in
33  /*) ;;
34  *)  set ./\$1 \$2 ;;
35esac
36
37: strip last component if it is to be a filename
38case X\$2 in
39  X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
40  *)  set \$1 ;;
41esac
42
43: return reasonable status if nothing to be created
44if $test -d "\$1" ; then
45    exit 0
46fi
47
48list=''
49while true ; do
50    case \$1 in
51    */*)
52        list="\$1 \$list"
53        set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\`
54        ;;
55    *)
56        break
57        ;;
58    esac
59done
60
61set \$list
62
63for dir do
64    $mkdir \$dir >/dev/null 2>&1
65done
66!GROK!THIS!
67$eunicefix makedir
68chmod +x makedir
Note: See TracBrowser for help on using the repository browser.