let search_in_path cmd =
if Filename.is_implicit cmd then
let path = List.find begin fun path ->
if path = Filename.current_dir_name then sys_file_exists cmd
else sys_file_exists (filename_concat path cmd)
end !*env_path in
filename_concat path cmd
else cmd