Unix administration - HELP NEEDED WITH UNIX COMMAND MAN

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2004 > HELP NEEDED WITH UNIX COMMAND MAN





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HELP NEEDED WITH UNIX COMMAND MAN
Lakshmi Jagarlapudi

2004-01-23, 5:01 pm

HI

Hey i have a quick question. How do we redirect the output of the man
command to file which
does not have junk or control charaters. i think there is an option.(like
man -x etc)

ex
man date > first.txt

the file first.txt is consisting of all kinds of control characters like
^H^M etc.

How do we get the readable output into the first.txt.

Please send the responses soon.

thanks,


phn@icke-reklam.ipsec.nu

2004-01-23, 5:01 pm

Lakshmi Jagarlapudi <jlnarayana@comcast.net> wrote:
quote:

> HI


quote:

> Hey i have a quick question. How do we redirect the output of the man
> command to file which
> does not have junk or control charaters. i think there is an option.(like
> man -x etc)


quote:

> ex
> man date > first.txt


quote:

> the file first.txt is consisting of all kinds of control characters like
> ^H^M etc.


quote:

> How do we get the readable output into the first.txt.


quote:

> Please send the responses soon.


quote:

> thanks,



Use 'col' to filter out :
SYNOPSIS
col [-bfhpx] [-l num]

DESCRIPTION
Col filters out reverse (and half reverse) line feeds so that the output
is in the correct order with only forward and half forward line feeds,
and replaces white-space characters with tabs where possible. This can
be useful in processing the output of nroff(1) and tbl(1).

Col reads from the standard input and writes to the standard output.

The options are as follows:

-b Do not output any backspaces, printing only the last character
written to each column position.


Your example will become :
man date | col -b > first.txt



--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.
Anne

2004-01-23, 5:01 pm

Direct man output and get it into some a useable format:
man command | col -b > command.txt

Cheers!






"Lakshmi Jagarlapudi" <jlnarayana@comcast.net> wrote in message news:<4%w4b.320628$uu5.66292@sccrnsc04>...
quote:

> HI
>
> Hey i have a quick question. How do we redirect the output of the man
> command to file which
> does not have junk or control charaters. i think there is an option.(like
> man -x etc)
>
> ex
> man date > first.txt
>
> the file first.txt is consisting of all kinds of control characters like
> ^H^M etc.
>
> How do we get the readable output into the first.txt.
>
> Please send the responses soon.
>
> thanks,


Jean-Rene David

2004-01-23, 5:01 pm

* Lakshmi Jagarlapudi <jlnarayana@comcast.net>:
quote:

> Hey i have a quick question. How do we redirect the output of the man
> command to file which does not have junk or control charaters.



man -Tascii date > foo.txt

Works for me.
Max Lapan

2004-01-23, 5:01 pm

Jean-Rene David <jrdavid@magma.ca.INVALID> writes:
quote:

>
> man -Tascii date > foo.txt
>



When we browse result on the terminal, it works, but it's not a plain
text.

shmuma@home:/tmp$ man -Tascii date | xxd | head -n 6
0000000: 4441 5445 2831 2920 2020 2020 2020 2020 DATE(1)
0000010: 2020 2020 2020 2020 2020 2020 2020 2046 F
0000020: 5346 2020 2020 2020 2020 2020 2020 2020 SF
0000030: 2020 2020 2020 2020 2020 4441 5445 2831 DATE(1
0000040: 290a 0a0a 0a4e 084e 4108 414d 084d 4508 )....N.NA.AM.ME.
0000050: 450a 2020 2020 2020 2064 6174 6520 2d20 E. date -

---
Best regards,
Max Lapan

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com