LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to produce a text file from man w/o formatting? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-produce-a-text-file-from-man-w-o-formatting-77284/)

spyghost 07-30-2003 09:14 AM

how to produce a text file from man w/o formatting?
 
hi,

i would like to produce a text file from a man page such that text wouldn't be formatted. what i did was this...

$ man smb.conf >texfile.txt

the text file was produced, but there are some "formatting" included. when editors such as vi, kedit, and the like are used to view the text file, one can see some "garbage" before letters that need formatting. from what i observed, only "cat" can view such files properly.

what i would like to know is how i can remove those automatically. is there a way to do this?

reason? i would like to send some man pages to a user who uses only windows os...

lfur 07-30-2003 12:13 PM

You can use:
man smb.conf | col -b > smb.conf.txt

This is also shown at the bottom of the man page for man:
man man

About that garbage ... usually ^H
You can use:
tr -d '^H' <inputfile> outpufile

^H can be inserted by holding Ctrl and typing v and h.

Enjoy

spyghost 07-30-2003 06:05 PM

thanks a lot... problem is solved


All times are GMT -5. The time now is 06:36 PM.