Bashスクリプトでコマンドの存在チェックをする時にwhichは使うべきではない。hashかtype使え。POSIX準拠ならcommand -v。

imiwonimiwon のブックマーク 2015/05/10 22:44

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

How can I check if a program exists from a Bash script?

    How would I validate that a program exists, in a way that will either return an error and exit, or continue with the script? It seems like it should be easy, but it's been stumping me.

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう