# 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 }; _' |
This comment has been minimized.
This comment has been minimized.
Thanks for this solution! |
This comment has been minimized.
This comment has been minimized.
Additionally, if one wants to make it available system-wide, one could add the lines to $> PA1="$(brew --prefix coreutil)/libexec/" ;
$> : ; # expand slashes (for sed use)
$> BINPA ="${PA1//\//\\/}gnubin" ;
$> MANPA ="${PA1//\//\\/}gnuman" ;
$> : ; # put as first line
$> sudo sed -i'' -e '1s/^/'"${BINPA}"'\n/' /etc/paths ;
$> sudo sed -i'' -e '1s/^/'"${MANPA}"'\n/' /etc/manpaths ; |
This comment has been minimized.
This comment has been minimized.
This solution makes the [section] argument for |
This comment has been minimized.
This comment has been minimized.
Not one to settle for hacky work-arounds, I did a bit of googling and eventually found this solution to work for adding the gnu manpages:
Hope that helps! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@JacobDorman Do you use oh-my-zsh or prezto? There is an alias for sudo(!) which causes this failure. So try to comment out the line |
This comment has been minimized.
This comment has been minimized.
The alias is not working with bash. |
This comment has been minimized.
This comment has been minimized.
@tasmo Ahh so there is. I never use that. |
This comment has been minimized.
This comment has been minimized.
What's wrong with just putting |
This comment has been minimized.
This comment has been minimized.
I have the same question as @OJFord. Why not just |
This comment has been minimized.
This comment has been minimized.
man section will not work, use alias man='_() { echo $@; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $@ 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $@; else man $@; fi }; _' |
This comment has been minimized.
Follow an article like this describing how to use Homebrew to setup GNU coreutils et al on your Mac.
Then when you want to spend less than a minute getting the manpages to work with both your new GNU programs and your Mac programs you still want to be able to use (like
mdfind
), paste this gist in your~/.profile
and away you go!