安装gentoo时, 出现使用man查看手册时出现一堆 ESC[ 之类的字符。
这些字符是consolse下的颜色控制。
了解了一下。 原来man命令也是调用外部程序来显示的。三个选项:
-P, -B, -H
然后对比一下ubuntu下的man和gentoo下的man, 发现不同的man手册这方面已经变化。
下面是gentoo的(man version 1.6f)
-P pager
Specify which pager to use. This option overrides the MANPAGER environment variable,
which in turn overrides the PAGER variable. By default, man uses /usr/bin/less -is.
下面是ubuntu9.10的(man 2.5.6)
-P pager, --pager=pager
Specify which output pager to use. By default, man uses pager -s. This option overrides the $MAN‐
PAGER environment variable, which in turn overrides the $PAGER environment variable. It is not
used in conjunction with -f or -k.
调用的程序已经不同.
在不安装pager程序下, 可以使用less程序的-R参数
-R or --RAW-CONTROL-CHARS
Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the
screen appearance is maintained correctly in most cases. ANSI "color" escape sequences
are sequences of the form:
所以, 让gentoo下的man不出现一堆 ESC[ , 可以:
export PAGER='less -R'
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.