Answers:
一种方法是将以下命令放入~/.profile:
export PAGER="col -b | open -a /Applications/Safari.app -f"
该PAGER环境变量控制什么程序man用来显示手册页。该col命令从手册页中删除所有退格格式。该open命令将输出另存为临时文本文件,并使用打开Safari.app。
或者,您可以在中编辑PAGER变量/private/etc/man.conf。您也可以编辑NROFF变量并消除使用的需要col -b。请参见手册页man.conf。
/usr/bin/edit --view-top --clean -t "Man page"
http://www.bruji.com/bwana/正是您想要的。
您可以在其中添加一个功能~/.bash_profile:
function gman () {
man "$1" | col -b > "/tmp/$1"
open -a "/Applications/Google Chrome.app" "/tmp/$1"
}
/Applications/其他地方?
/Applications/。
source ~/.profile
/tmp/$1.txt。
export PAGER="col -b | open -a /Applications/Google\ Chrome.app -f"因此它将在Chrome中而不是Safari中打开。