From
I don't want escape code to emphasize text. I want a really plain text output. I tried to read more about man, groff, whatever in man's manpage... I wasn't sure how a manpage being generated.
The easiest workaround is to remove escape code by myself:
I still need: setting text width of output or no wrapping.
Updated: This would do
man man
:man foo | col -b > foo.mantxtIt doesn't work for me, this what I got:
1mNAME0m bash - GNU Bourne-Again SHell 1mSYNOPSIS0m 1mbash 22m[options] [file]
\033[
were removed but the rest of escape code still there. I am not sure why those escape code were modified by col. Anyway, col is obvious not what I need.I don't want escape code to emphasize text. I want a really plain text output. I tried to read more about man, groff, whatever in man's manpage... I wasn't sure how a manpage being generated.
The easiest workaround is to remove escape code by myself:
man bash | sed $'s/\033\[[^m]*m//g' > bash.txt(It's still some non-printing chars in the output, run with
cat -v
)I still need: setting text width of output or no wrapping.
Updated: This would do
( echo ".ll 11.5i"; echo ".nr LL 11.5i"; echo ".pl 1100i"; /bin/bzip2 -c -d "/usr/share/man/man1/bash.1.bz2"; echo ".\\\""; echo ".pl \n(nlu+10" ) | /usr/bin/gtbl | /usr/bin/nroff -mandoc | sed $'s/\033\[[^m]*m//g' > bash.txt
. The numbers control the width, but I don't have any idea how to calculator them from text width I need.
0 comments:
Post a Comment