Search Results

Search: Posts Made By: netmaster
28,438
Posted By Corona688
You're almost there. elif [ "$DIR" != -d ]...
You're almost there.

elif [ "$DIR" != -d ] This checks if the string "$DIR" is the same as the string "-d", which of course it isn't.

You had it right in the last statement, with [ ! -d "$DIR"...
28,438
Posted By vgersh99
you almost got it: .... elif [ ! -e "$DIR"...
you almost got it:

....
elif [ ! -e "$DIR" ]
then
echo "Directory does not exist!"
exit 4
elif [ ! -d "$DIR" ]
then
echo "Not a Directory"
...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 07:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy