-
-
Save samyranavela/8f87bccb6d7744c12b673d0585fb1606 to your computer and use it in GitHub Desktop.
check if command exists (linux, mac)
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
| function command_exists { | |
| #this should be a very portable way of checking if something is on the path | |
| #usage: "if command_exists foo; then echo it exists; fi" | |
| type "$1" &> /dev/null | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment