Question

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)

NAME
    prog - runs a program

Version          0.1                                                      26              AUG                                 2010



I'm on 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. What's going on?

Was it helpful?

Solution

Because man runs groff itself internally - it's not expecting you to have done it already. Just copy your source.txt straight into /usr/local/man/man1/prog.1, and it should work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top