Skip to content

Instantly share code, notes, and snippets.

@brosenberg
Created July 1, 2015 23:23
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 brosenberg/bc2107c0e6b331706d72 to your computer and use it in GitHub Desktop.
Save brosenberg/bc2107c0e6b331706d72 to your computer and use it in GitHub Desktop.
#!/bin/bash
P=""
for i in $(sed 's/:/ /g' <<<$PATH); do
P="$P $(find $i -maxdepth 1 -mindepth 1 -type f -executable -exec basename {} \;)"
done
man $(echo -e $(sed 's/ /\\n/g' <<<$P) | rl | tail -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment