Created
October 23, 2012 13:30
-
-
Save kanonji/3938742 to your computer and use it in GitHub Desktop.
シェルスクリプトでコマンドの有無を判別する。
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/sh | |
echo "Finding $1..." | |
# if whereis $1 >/dev/null 2>&1; then 判別出来ない。 | |
# if type $1 >/dev/null 2>&1; then 判別出来る。 | |
# if which $1 >/dev/null 2>&1; then 判別出来る。 | |
if which $1 >/dev/null 2>&1; then | |
echo "$1 found." | |
else | |
echo "$1 not found." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment