Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help about the man usage

1 view
Skip to first unread message

gg

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
Hello all,
    I want to save the man pages to the text file, so I can use vi or other edit tool to view them. but the output file has so many control codes, it is hardly to see.
    Pls help me to deal with it, thank a lot.
 

Andrei Ivanov

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
gg <gen...@cintel.com.cn> wrote:
> I want to save the man pages to the text file, so I can
> use vi or other edit tool to view them. but the output file
> has so many control codes, it is hardly to see.

$ man man | col -b > file.txt

--
andrei

peter@icke-reklam.manet.dot..nu

unread,
May 17, 2000, 3:00:00 AM5/17/00
to

you better edit the manpage SOURCE.


> --
> andrei

--
--
Peter Håkanson
Manet Networking (At the Riverside of Gothenburg, home of Volvo)
Sorry about my e-mail address, but i'm trying to keep spam out.
echo "peter (at) manet (dot) nu" | sed "s/(at)/@/g " | sed "s/(dot)/\./g"|sed "s/ //g"

Bernard Chandler

unread,
May 18, 2000, 3:00:00 AM5/18/00
to
pe...@icke-reklam.manet.dot..nu. wrote:

O.K. Peter
I know what Andri meant as this is what people have done for years. Now you come a long
with this cryptic one liner.
What are you trying to say .. spit it out .. elaborate.


--
Bernie Chandler
http://www.nationwide.net/~bernie

peter@icke-reklam.manet.dot..nu

unread,
May 18, 2000, 3:00:00 AM5/18/00
to

Every manpage has a source written in nroff (or compatible format.)
Included in the source is "macro commands" that describes the final
format of the text.

Running nroff on the source generates the "manpages" in a human-comprahensible
format, adjusted to whatever your needs are.

Lets say you would like to print them but using a different paper size the
the standard US. Fine, locate the macro that desribes your page length,
change it, run nroff - ans voila, your manpages will fit nice on 72-lines
paper (used in sweden)

A snipped of a "typical" manpage might serve as example. I'll choose
a random selection - the "id" command from FreeBSD :

.Dd June 6, 1993
.Dt ID 1
.Os BSD 4.4
.Sh NAME
.Nm id
.Nd return user identity
.Sh SYNOPSIS
.Nm
.Op Ar user
.Nm id
.Fl G Op Fl n
.Op Ar user
.Nm id
.Fl P
.Op Ar user
.Nm id
.Fl g Op Fl nr
.Op Ar user
.Nm id
.Fl p
.Nm id
.Fl u Op Fl nr
.Op Ar user
.Sh DESCRIPTION
The
.Nm
utility displays the user and group names and numeric IDs, of the
calling process, to the standard output.
If the real and effective IDs are different, both are displayed,
otherwise only the real ID is displayed.
.Pp
If a
.Ar user
(login name or user ID)
is specified, the user and group IDs of that user are displayed.
In this case, the real and effective IDs are assumed to be the same.
<end snippet>

This manpage is shown on screen as
(using the command " gzcat man1/id.1.gz | nroff -man | less" ) :

ID(1) FreeBSD General Commands Manual ID(1)

NAME
id - return user identity

SYNOPSIS
id [user]
id -G [-n] [user]
id -P [user]
id -g [-nr] [user]
id -p
id -u [-nr] [user]

DESCRIPTION
The id utility displays the user and group names and numeric IDs, of the
calling process, to the standard output. If the real and effective IDs
are different, both are displayed, otherwise only the real ID is dis-
played.


There is of course the nasty possibility that the vendor has left
out man-page sources from the system. In that case there does not
(to my knowledge) exists any tool to recreate the source.

If applied pressure on the vendor does not return man-page sources,
one can always switch vendor(or manually recreate the source, whichever
is most convenient :-)


> --
> Bernie Chandler
> http://www.nationwide.net/~bernie

--

Mike Worthen

unread,
May 19, 2000, 3:00:00 AM5/19/00
to
If you do the following you will be able to read the page in a flat file:

man lp > lp.txt
vi lp.txt
<esc>:%s/.^V^H//g<enter>


This will format the page so you can read it.

Mike

Bernard Chandler

unread,
Jun 8, 2000, 3:00:00 AM6/8/00
to
pe...@icke-reklam.manet.dot..nu. wrote:

thanks this is quite clear and informative.

0 new messages