2002-03-22 20:16:45

by walt

[permalink] [raw]
Subject: printing from command line

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.

Thanks!

--
Walter Anthony
System Administrator
National Electronic Attachment
"If it's not broke....tweak it"




2002-03-22 21:10:55

by Jesse Pollard

[permalink] [raw]
Subject: Re: printing from command line

walt <[email protected]>:
>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.

2002-03-22 21:21:35

by Mr. James W. Laferriere

[permalink] [raw]
Subject: Re: printing from command line


Hello Walt , man a2ps . Give that a try or if not found give the
net a search on it . Hth , JimL

On Fri, 22 Mar 2002, walt wrote:

> 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.
>
> Thanks!
>
> --
> Walter Anthony
> System Administrator
> National Electronic Attachment
> "If it's not broke....tweak it"
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network Engineer | P.O. Box 854 | Give me Linux |
| [email protected] | Coudersport PA 16915 | only on AXP |
+------------------------------------------------------------------+

2002-03-22 21:25:35

by Richard B. Johnson

[permalink] [raw]
Subject: Re: printing from command line

On Fri, 22 Mar 2002, walt wrote:

> 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.
>
> Thanks!

I think you want `pr` although some formatting isn't automatic. `man pr`
shows it takes more parameters than `ls`. Fortunately, you can make
an alias.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

Windows-2000/Professional isn't.