find_in_path multimethod

Methods

find_in_path(executable_name:Str) Source: stdlib.ngs:4181
Finds given binary and returns it's full path. Throws ExecutableNotFound if the binary was not found. Search strategy: "/" in the name of the binary means that given executable_name is a path so it's returned as-is (wrapped in Path). If PATH environment variable exists, the given directories are searched. If PATH is not set built-in value for PATH is used to search: /usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin

Returns

Path

Example

find_in_path("ls")  # <Path path=/bin/ls>