tags:

views:

117

answers:

3

Hi,

I want to get only specific sections of MAN page inside a shell (or perl) script and print it.

For eg: only the SYNOPSIS section of MAN page

Is there any standard way to do that?

Regards, Anandan

A: 

Type the '/' key, then type the string you want to search for (you'll see your query at the bottom of the terminal as you type) and press enter. It'll highlight all the matches and take you to the first one. After that, type '/' and press enter to go to the next match.

rob
Well, yes, but that's based on the commandset of the current $PAGER.
Anirvan
i can only view the section here.. but i want to get that section and print it.. :(
Anandan
+1  A: 

I haven't played with Linux/Unix in a long while, but perhaps you can perform a:

man MANPAGE|a2ps -m > grep -A 1000 SYNOPSIS
David Glass
A: 

Not as far as I know, but you can search by typing '/' followed by the text you want to search for, then pressing 'n' repeatedly to got to the next match, or 'N' to go to the previous match.

Cameron