def search_paths(path = ENV['PATH'])
      paths = if path && !path.empty?
                path.split(::File::PATH_SEPARATOR)
              else
                %w(/usr/local/bin /usr/ucb /usr/bin /bin)
              end
      paths.select(&Dir.method(:exist?))
    end
def search_paths(path = ENV['PATH'])
      paths = if path && !path.empty?
                path.split(::File::PATH_SEPARATOR)
              else
                %w(/usr/local/bin /usr/ucb /usr/bin /bin)
              end
      paths.select(&Dir.method(:exist?))
    end
Find default system paths

 @param [String] path
   the path to search through

 @example
   search_paths("/usr/local/bin:/bin")
   # => ['/bin']

 @return [Array[String]]
   the array of paths to search

 @api private