Skip to contentSkip to conversation

printing from command line

DISCUSSION Jesse Pollard 1 participant 1 message Mar 22, 2002

lore
Share & tools
lore
#0 lore raw

walt <[email protected]>:

Quoted 9 lines

This is a general linux question, not really a kernel question. Does anyone know if there is a "simple" good way to print code from linux at the command promt. On a Solaris machine, /usr/openwin/bin/mp -o -l filename
gives me a page with 2 columuns, user_name, date, and pagenumber at the top of each column, and the filename at the bottom of each column. I've read lots of howtos and man pages, even wrote a perl script to wrap the lines for me, but I haven't figured out how to get the same format from Linux as I do from Solaris.

check the "pr" command:

pr -m file1 file2

Will format the output in two columns, file1 on the left, file2 on the right.

It doesn't include username, but does have the date (top left) and page number (top right).

An arbitrary title/heading may be specified with the -h option. The heading is at the top, center of each page.

I've found that a single column was best based on readability (most source files will indent so far to the right that only a single column will do).

If you want fancier printing try enscript, this utility allows for 1/2/n columns. (This one does a nice job for line numbers). The output is postscript - so options for various fonts and sizes are available.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.