findProgram name
findProgram(name, cmd)
findProgram(name, cmds)
This function checks for the existence of an external program by running cmd (or every element of cmds), prepended with various paths in the following order:
For each path, any prefixes specified by the Prefix option are checked.
Once this is successful (i.e., cmd or each element of cmds returns a value of 0) then a Program object is returned. If it is unsuccessful, then either an error is raised or null is returned, depending on the value of RaiseError.
Note that if a program consists of a single executable binary file, then name should coincide with the name of this file.
|
|
|
If cmd is not provided, then cmd is run with the common --version command line option.
|
One program that is shipped with a variety of prefixes in different distributions and for which the Prefix option is useful is TOPCOM:
|
Note that when using the MinimumVersion option, the command used to obtain the current version number must remove everything except the version number itself and any leading or trailing whitespace. Piping with standard UNIX utilities such as sed, head, tail, cut, and tr may be useful.
|
The object findProgram is a method function with options.