canering
10/1/2016 - 10:18 AM

Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!

Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!

# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1;  if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'