I'm working on a command line scripting framework. We would like to generate man pages for our commands. However they are quite dynamic depending on your installation. So ideally we could intercept the man call and write the man page at that time or simply pipe it to the man display directly.

I'm quite new to man pages and how they work. Is this even possible?

  • Why don't you just write your own man pages instead of trying to do something obfuscated? Also, if you're trying to preview manpages, then you can use man -l <FILE> Dec 24, 2013 at 20:00

2 Answers 2


I've never heard of this method employed and would caution you to doing something that might seem to make sense from your perspective as a developer but is actually less optimal or obscure from your users and/or the administrators that will ultimately be the users/supports of your application framework.

This is a constant mistake that I see developers make where they create something that makes their lives easier but is just more custom one-off solutions that administrators/users have to familiarize themselves with.

I would look into creating a method that would auto generate your man pages and make this part of either the scripted installation you provide or as part of the package manager of systems where your software is deployed.

There are a number of methods for doing exactly this. It might seem less optimal but it's more in line with how users of your software will likely expect your software to operate.

This tutorial should get you started in understanding man page formats, they're pretty straightforward and lend themselves to being modified fairly easily during installation.


This sounds like a horrible idea!

The manual pages are supposed to clearly document all features and their availability, especially for something like a higher-level scripting language!

To simply have all the extra material omitted is to not care about the implications of the users moving from one installation to the next. (It'll also promote monocultures, and possibly all sorts of vendor lock-ins.)

And if you don't care about the well-being of your users, why provide a man-compatible manual page in the first place?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .