Is there a way to get the source out of the a preformatted man page? I need to parse the man page sources on different platforms and on one pc there are only cat pages, and I don't want to write 2 scripts for both situations.
Greets, Oliver
Is there a way to get the source out of the a preformatted man page? I need to parse the man page sources on different platforms and on one pc there are only cat pages, and I don't want to write 2 scripts for both situations.
Greets, Oliver
You can't "generate" the *roff source from a formatted man page. However, you could simply write your script to work with the formatted version, and then run unformatted man pages through nroff. This way, you write one script instead of two and it works on all your target platforms.
You should probably look at man man.
You can find the source file for a given man page with man --path command - so man --path man will give a result of /usr/share/man/en/man1/man.1.gz