Menu

#6 IF statement that can cause errors

open
nobody
None
5
2006-05-19
2006-05-19
No

the following code (from your script) checks the
current folder for the directory for the working
folder, and not if the folder exists in the working
directory. well ill let the code speak for itself
//CODE
if [[ ! -d $DISK_TITLE ]]; then
mkdir $WORKING_DIR/$DISK_TITLE 2>> $PROCESS_LOG 1>>
$PROCESS_LOG
else
echo "Directory $WORKING_DIR/$DISK_TITLE already
exists. Continuing."
fi
//CODE_END
this if statement should be changed to:
if [[ ! -d $WORKING_PATH/$DISK_TITLE ]]; then
rather then just checking the folder from within the
script is executed

Discussion


Log in to post a comment.