1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/bin/csh
#
# This script is to guarantee that a directory exists. It will only
# make a new directory at the last level in a hierarchy, so don't
# expect it to go down a full path.
#
# Usage: createdirectory <directory>
if ($1 == "") then
echo "Usage: createdirectory <directory>"
exit 1
endif
if (-e $1) then
exit 0
endif
#echo Directory $1 does not exist. Trying to create $1.
mkdir -m 775 $1
if ($status != 0) then
echo Unable to create $1
endif
exit $status
|