Is there a neater idiom for this:

#!/bin/sh

if test -f $1 
then
  if test ! -d $1 
  then
    echo "$1 exists and is not a directory"
    exit 1
  fi
else
  mkdir -p $1
fi
#########

If a file exists and is not a directory, bail out, otherwise create the
directory.

Dave

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to