head	1.2;
access;
symbols
	camas_1_3:1.1.1.1 camas:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2003.03.19.11.16.47;	author kiwi;	state dead;
branches;
next	1.1;

1.1
date	2003.03.18.10.42.01;	author vida;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2003.03.18.10.42.01;	author vida;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Fixing yesterday vida's work.... :p
@
text
@#!/bin/sh
# $Id: mkdir,v 1.1 2003/03/18 10:42:01 vida Exp $
#
# Make a directory and all it's parents.
# this is how mkdir works on most systems, but not all.

for a in $@@ ; do
  case $a in 
    --help)
cat <<EOF
Usage: mkdir [OPTION] DIRECTORY...
 
  -p, --parents     no error if existing, make parent directories as needed
      --help        display this help and exit
      --version     output version information and exit
EOF
      exit
    ;;
    --version)
      echo Per hacks 0.0
      exit
    ;;
    -p)
      recurse=1;
    ;;
    /*)
      dname=$a
      dir=""
    ;;
    *)
      dname=$a
      dir="."
    ;;
  esac
done

if [ x$recurse = x ] ; then
  /bin/mkdir $dname
  exit $?
fi

IFS='/'

for a in $dname; do
  IFS=' '
  dir="$dir/$a"
  if [ ! -d $dir ] ; then
    /bin/mkdir $dir || exit 1
  fi
done
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
# $Id: mkdir,v 1.1 2001/09/14 17:20:40 kiwi Exp $
@


1.1.1.1
log
@maybe it will work this time.
@
text
@@
