On 22-Jan-2012 Siteshwar Vashisht wrote: > Hi, > Is there any option in groff to parse only a specifiec > section of man page? For e.g. when I say > > groff -X -P -resolution -P100 -man passwd > > It parses and shows me the whole page. What if I want to > parse only OPTIONS section ? I am looking for something like :- > > groff -X -P -resolution -P100 -man -parse-section "OPTIONS" passwd > > Regards, > Siteshwar > -- > "A belief may be larger than a fact." > Vannevar Bush
No, groff always processes the entire document as presented in the troff source for the document. The only way to achieve what you want would be to edit the source for "passwd", incorporating ".if [...]" requests so that what is compiled by groff could depend on options defined in the command-line. The option for that would then be like groff .... -dSection="OPTIONS" .... and then, for every section in the man-page, include a ".if" statement such that a) If the string register "Section" is not defined then include the section; b) If "Section" is defined, then include the section if "Section" matches the name of th section. Even then, this would only output a single section. If you wanted to choose more than one section you would have to devise a more complicated system! (Could be done, but no-one is going to re-write the man pages like this anyway)! Ted. ------------------------------------------------- E-Mail: (Ted Harding) <ted.hard...@wlandres.net> Date: 22-Jan-2012 Time: 09:07:26 This message was sent by XFMail -------------------------------------------------