commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Put this code in a bash script. The script expects the PDF file as its only parameter.
It will add a header to the PDF containing the page numbers and output it to a file with the suffix "-header.pdf"
Requires enscript, ps2pdf and pdftk.
Quick and dirty version. I made a version that checks if a manpage exists (but it's not a oneliner). You must have ps2pdf and of course Ghostscript installed in your box.
Enhancements appreciated :-)