Search code examples
bashmanpageaspell

Run aspell on manpage


I want use Aspell on man page but i have problem with word splitting. I use man man | col -bx | aspell (...) but "man man | col -bx " return text with spitted words i.e:

"man formats and displays the on-line man-
ual pages. If you specify section, man on-
ly looks in that section of the manual."

So Aspell return this words as wrong.

Any ideas how switch it off?


Solution

  • You want to format the man pages without hyphenation. This should do it:

     groff -mtty-char -Tutf8 -man -rHY=0 /usr/share/man/man1/man.1
    

    Alternatively tell it the page is so wide that it never hyphenates:

     groff -mtty-char -Tutf8 -man -rLL=1000000 /usr/share/man/man1/man.1
    

    And now some explanation, so you know where to find this stuff. man formats pages with nroff, which is just a script around groff. You can find out what that does with:

    sh -x $(which nroff) -man /usr/share/man/man1/man.1
    

    This in turn will spit out a groff command similar to the one above. You can then find out what groff does internally with -V:

    groff -mtty-char -Tutf8 -man -V /usr/share/man/man1/man.1
    

    ...and find out about the hyphenation flags I used with

    man groff_man