Last active
August 29, 2015 14:15
-
-
Save sdumetz/eec7616f00bdf5725072 to your computer and use it in GitHub Desktop.
check command existence, get script dir...
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
### CHECK IF COMMAND IS AVAILABLE ### | |
command -v foo >/dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
#Command found | |
else | |
#command not found | |
fi | |
###GET SCRIPT DIRECTORY #### | |
DIR="$( cd "$( dirname "$0" )" && pwd )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment