Created
August 8, 2015 02:05
-
-
Save FabioFleitas/450eed0d3a7119413b9b to your computer and use it in GitHub Desktop.
Displays EXAMPLES section of man pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eg() { | |
MAN_KEEP_FORMATTING=1 man "$@" 2>/dev/null \ | |
| sed --quiet --expression='/^E\(\x08.\)X\(\x08.\)\?A\(\x08.\)\?M\(\x08.\)\?P\(\x08.\)\?L\(\x08.\)\?E/{:a;p;n;/^[^ ]/q;ba}' \ | |
| ${MANPAGER:-${PAGER:-pager -s}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment