Skip to content

Instantly share code, notes, and snippets.

@ormaaj
Created May 19, 2015 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ormaaj/00b34878d3cf4245c8cb to your computer and use it in GitHub Desktop.
Save ormaaj/00b34878d3cf4245c8cb to your computer and use it in GitHub Desktop.
IFS=: read -ra paths <<<"$PATH"; eval "printf '<%s> ' find / \( -type d \( $(printf -- '-name %q -o ' "${paths[@]::${#paths[@]} - 1}") -name \"\${paths[-1]}\" \) \) -prune -o \( -type f -executable -print -quit \)" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment