Let's say I'm writing something that depends on external programs, like svn. How do I check for their existence automatically, so I can print a helpful error message when they're absent? Iterating through PATH is possible, but hardly elegant and efficient. Are there cleaner solutions?
I've seen this behavior in a bootstrapping script, though I can't remember where. It looked a little like this:
checking for gcc... yes
system()in C or via the command line, basically. And yes, Linux/Unix. (See tag.)