How to print man pages on letter size paper

Tony Nelson tonynelson at georgeanelson.com
Wed Feb 8 17:41:46 UTC 2006


At 9:24 PM -0500 2/7/06, Michael D. Berger wrote:
 ...
>This is a script that I call "mantxt" to generate text from
>man pages.  Suggestions for improvement are welcome.

OK!

>--
>
>#!/bin/bash
>if test $# != 2; then
>   echo "Calling Format: mantxt <section> <name>"
>   exit 1
>fi
>
>if test -f /usr/share/man/man$1/$2.$1.gz; then
>   zcat /usr/share/man/man$1/$2.$1.gz | groff -Tascii -mandoc | col -b
>elif test -f /usr/share/man/man$1/$2.$1; then
>   cat /usr/share/man/man$1/$2.$1 | groff -Tascii -mandoc | col -b
>elif test -f /usr/share/man/man$1/$2.$1ssl.gz; then
>   zcat /usr/share/man/man$1/$2.$1ssl.gz | groff -Tascii -mandoc | col -b
>else
>   echo "cannot find file"
>fi

According to man man, you can use -W to get the path to the man page in a
form useful to xargs, something like:

    man -W $1 $2 | xargs zcat | groff -Tascii -mandoc | col -b

>
>exit 0

____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
      '                              <http://www.georgeanelson.com/>




More information about the fedora-list mailing list