This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 2.0 patch 1: removed redundant debugging code in regexp.c
[perl5.git] / makedir.SH
CommitLineData
8d063cd8
LW
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
378cc40b 9 . ./config.sh
8d063cd8
LW
10 ;;
11esac
12case "$0" in
13*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
14esac
15echo "Extracting makedir (with variable substitutions)"
16$spitshell >makedir <<!GROK!THIS!
17$startsh
378cc40b 18# $Header: makedir.SH,v 2.0 88/06/05 00:09:13 root Exp $
8d063cd8
LW
19#
20# $Log: makedir.SH,v $
378cc40b
LW
21# Revision 2.0 88/06/05 00:09:13 root
22# Baseline version 2.0.
8d063cd8 23#
8d063cd8
LW
24#
25
26export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$)
27
28case \$# in
29 0)
30 $echo "makedir pathname filenameflag"
31 exit 1
32 ;;
33esac
34
35: guarantee one slash before 1st component
36case \$1 in
37 /*) ;;
38 *) set ./\$1 \$2 ;;
39esac
40
41: strip last component if it is to be a filename
42case X\$2 in
43 X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
44 *) set \$1 ;;
45esac
46
47: return reasonable status if nothing to be created
48if $test -d "\$1" ; then
49 exit 0
50fi
51
52list=''
53while true ; do
54 case \$1 in
55 */*)
56 list="\$1 \$list"
57 set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\`
58 ;;
59 *)
60 break
61 ;;
62 esac
63done
64
65set \$list
66
67for dir do
68 $mkdir \$dir >/dev/null 2>&1
69done
70!GROK!THIS!
71$eunicefix makedir
378cc40b 72chmod +x makedir