Created
August 1, 2012 20:09
-
-
Save biswarupadhikari/3230268 to your computer and use it in GitHub Desktop.
How to check a Directory Exist or Not In Shell Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ If Directory Exist ############### | |
if [ -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY exists. | |
fi | |
############ If Directory NOT Exist ############### | |
if [ ! -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY doesn't exist. | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment