in reply to Parsing (l)unix man pages

perl -e 'open(F,"man ssh|")||die;print while(<F>);'
Works fine for me, prints the man page just as it should...
What exactly is it that doesnt work?

T I M T O W T D I

Replies are listed 'Best First'.
Re: Re: Parsing (l)unix man pages
by elp (Novice) on Aug 21, 2001 at 10:16 UTC
    If you send the man output to a file, you will see that the lines look something like:
    D^HDE^HES^HSC^HCR^HRI^HIP^HPT^HTI^HIO^HON^HN
    You can either use a perl script to take them out, or us lazy/smart types use:
    open(F,"man ssh| col -b |")
    People on old legacy unix boxes with crappy pagers have been using col -b for years to dump plain text to a file which can then be looked at with a text editor.