[英]Why is my man page formatted incorrectly ONLY when viewed with man?
I am writing a man page for a program, the source looks like this: 我正在为程序编写手册页,源代码如下:
.TH prog 1 "26 AUG 2010" "Version 0.1" "Center header"
.NAME
prog \- runs a program
.SH SYNOPSIS
.B prog
When I use 当我使用
$ groff -Tascii -man source.txt | more
the output is pretty much as expected. 输出几乎与预期的一样。
When I use: 当我使用时:
$ groff -Tascii -man source.txt > prog.1 && \
sudo cp prog.1 /usr/local/man/man1/ && man prog
the ouput looks like this: 输出看起来像这样:
prog(2) Center header prog(2)中心头
prog(2) PROG(2)
NAME 名称
prog - runs a program 编-运行程序
Version 0.1 26 AUG 2010 版本0.1 2010年8月26日
I'm on Ubuntu 8.04. 我正在使用Ubuntu 8.04。 I've verified that it isn't the pager because I also tried man -P more
and still had the same odd output. 我已经证实它不是寻呼机,因为我也尝试了man -P more
并且仍然具有相同的奇数输出。 What's going on? 这是怎么回事?
Because man
runs groff
itself internally - it's not expecting you to have done it already. 因为man
在内部自己运行groff
并不指望您已经做到了。 Just copy your source.txt
straight into /usr/local/man/man1/prog.1
, and it should work fine. 只需将您的source.txt
直接复制到/usr/local/man/man1/prog.1
,它就可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.