diff options
author | Larry Wall <lwall@netlabs.com> | 1993-10-07 23:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1993-10-07 23:00:00 +0000 |
commit | 79072805bf63abe5b5978b5928ab00d360ea3e7f (patch) | |
tree | 96688fcd69f9c8d2110e93c350b4d0025eaf240d /makedir | |
parent | e334a159a5616cab575044bafaf68f75b7bb3a16 (diff) | |
download | perl-79072805bf63abe5b5978b5928ab00d360ea3e7f.tar.gz |
perl 5.0 alpha 2perl-5a2
[editor's note: from history.perl.org. The sparc executables
originally included in the distribution are not in this commit.]
Diffstat (limited to 'makedir')
-rwxr-xr-x | makedir | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/makedir b/makedir new file mode 100755 index 0000000000..51986a8a2d --- /dev/null +++ b/makedir @@ -0,0 +1,58 @@ +#!/bin/sh +# : makedir.SH,v 15738Revision: 4.1 15738Date: 92/08/07 18:24:23 $ +# +# $Log: makedir.SH,v $ +# Revision 4.1 92/08/07 18:24:23 lwall +# +# Revision 4.0.1.1 92/06/08 14:24:55 lwall +# patch20: SH files didn't work well with symbolic links +# +# Revision 4.0 91/03/20 01:27:13 lwall +# 4.0 baseline. +# +# + +export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$) + +case $# in + 0) + /bin/echo "makedir pathname filenameflag" + exit 1 + ;; +esac + +: guarantee one slash before 1st component +case $1 in + /*) ;; + *) set ./$1 $2 ;; +esac + +: strip last component if it is to be a filename +case X$2 in + X1) set `/bin/echo $1 | /bin/sed 's:\(.*\)/[^/]*$:\1:'` ;; + *) set $1 ;; +esac + +: return reasonable status if nothing to be created +if test -d "$1" ; then + exit 0 +fi + +list='' +while true ; do + case $1 in + */*) + list="$1 $list" + set `echo $1 | /bin/sed 's:\(.*\)/:\1 :'` + ;; + *) + break + ;; + esac +done + +set $list + +for dir do + /bin/mkdir $dir >/dev/null 2>&1 +done |