locateTool

fnstring locateTool(string name, string[] extraDirs = ["/usr/sbin", "/usr/local/sbin", "/sbin"])

Searches PATH and additional system tool directories for an executable file.

Parameters

nameExecutable file name to look for.
extraDirsDirectories searched after the PATH entries. Useful for tools such as sshd that live in directories commonly absent from non-login shell paths.

Returns

Absolute path to the executable, or null when not found.