Last active
August 29, 2015 14:03
-
-
Save babo/73201533548d3c0dfa1d to your computer and use it in GitHub Desktop.
how to find an executable
This file contains hidden or 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/bash | |
WHAT=${1:-ngrok} | |
if [ hash ${WHAT} 2>/dev/null ]; then | |
echo original found ${WHAT} | |
else | |
echo original failed ${WHAT} | |
fi | |
hash ${WHAT} 2>/dev/null | |
if [ $? -eq 0 ]; then | |
echo new found ${WHAT} | |
else | |
echo new failed ${WHAT} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment