CodyKochmann
2/23/2016 - 3:35 PM

check if a directory exists in a shell script. source - http://stackoverflow.com/questions/59838/check-if-a-directory-exists-in-a-shell-scr

if [ -d "$DIRECTORY" ]; then
  # Control will enter here if $DIRECTORY exists.
fi

if [ ! -d "$DIRECTORY" ]; then
  # Control will enter here if $DIRECTORY doesn't exist.
fi