I'm just curious to know how to best check if a program exists. I've seen solutions with
Which is the best method, is there a right answer? What does the POSIX and LSB specs say about this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You probably want to use the
command command, e.g.:
command -v <the_command>
For more discussion see the following StackOverflow posts:
Also see the following Unix StackExchange post: