File:  [CSRG BSD Unix] / 43BSD / contrib / nntp / rrn / makedir
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:54 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

#!/bin/sh
# $Header: /var/lib/cvsd/repos/CSRG/43BSD/contrib/nntp/rrn/makedir,v 1.1.1.1 2018/04/24 16:12:54 root Exp $
# 
# $Log: makedir,v $
# Revision 1.1.1.1  2018/04/24 16:12:54  root
# BSD 4.3
#
# Revision 4.3  85/05/01  11:42:31  lwall
# Baseline for release with 4.3bsd.
# 

export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)

case $# in
  0)
    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 `echo $1 | sed 's:\(.*\)/[^/]*$:\1:'` ;;
  *)  set $1 ;;
esac

: return reasonable status if nothing to be created
if /bin/test -d "$1" ; then
    exit 0
fi

list=''
while true ; do
    case $1 in
    */*)
	list="$1 $list"
	set `echo $1 | sed 's:\(.*\)/:\1 :'`
	;;
    *)
	break
	;;
    esac
done

set $list

for dir do
    mkdir $dir >/dev/null 2>&1
done

unix.superglobalmegacorp.com

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