Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created January 11, 2014 21:57
Show Gist options
  • Select an option

  • Save coderofsalvation/8377488 to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/8377488 to your computer and use it in GitHub Desktop.
checks if given parameter is a directory
# checks if given parameter is a directory
# @param string input
# usage: is_dir /my/path || { echo "directory does not exist"; exit 1; }
is_dir(){
[[ -d "$1" ]] && return 0 || return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment