Created
October 6, 2015 04:57
-
-
Save namomo/5e05c9f26bac4119963b to your computer and use it in GitHub Desktop.
check_condition.sh
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
#!/bin/sh | |
# To check if a directory exists in a bash shell script you can use the following: | |
if [ -d "$DIRECTORY" ]; then | |
# Will enter here if $DIRECTORY exists | |
fi | |
# Or to check if a directory doesn't exist: | |
if [ ! -d "$DIRECTORY" ]; then | |
# 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