Annotation of 43BSD/contrib/nntp/rrn/makedir, revision 1.1

1.1     ! root        1: #!/bin/sh
        !             2: # $Header: makedir.SH,v 4.3 85/05/01 11:42:31 lwall Exp $
        !             3: # 
        !             4: # $Log:        makedir.SH,v $
        !             5: # Revision 4.3  85/05/01  11:42:31  lwall
        !             6: # Baseline for release with 4.3bsd.
        !             7: # 
        !             8: 
        !             9: export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
        !            10: 
        !            11: case $# in
        !            12:   0)
        !            13:     echo "makedir pathname filenameflag"
        !            14:     exit 1
        !            15:     ;;
        !            16: esac
        !            17: 
        !            18: : guarantee one slash before 1st component
        !            19: case $1 in
        !            20:   /*) ;;
        !            21:   *)  set ./$1 $2 ;;
        !            22: esac
        !            23: 
        !            24: : strip last component if it is to be a filename
        !            25: case X$2 in
        !            26:   X1) set `echo $1 | sed 's:\(.*\)/[^/]*$:\1:'` ;;
        !            27:   *)  set $1 ;;
        !            28: esac
        !            29: 
        !            30: : return reasonable status if nothing to be created
        !            31: if /bin/test -d "$1" ; then
        !            32:     exit 0
        !            33: fi
        !            34: 
        !            35: list=''
        !            36: while true ; do
        !            37:     case $1 in
        !            38:     */*)
        !            39:        list="$1 $list"
        !            40:        set `echo $1 | sed 's:\(.*\)/:\1 :'`
        !            41:        ;;
        !            42:     *)
        !            43:        break
        !            44:        ;;
        !            45:     esac
        !            46: done
        !            47: 
        !            48: set $list
        !            49: 
        !            50: for dir do
        !            51:     mkdir $dir >/dev/null 2>&1
        !            52: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.