[OLUG] printing issue

Chad S. Lauritsen csl at plconline.com
Wed Feb 16 17:30:04 UTC 2000


I think the stair-stepping text is caused by a lack of a carriage return
with the linefeed at the end of each line. A simple perl or sed filter
hack may fix it. e.g., to print the hosts file using perl:

cat /etc/hosts | perl -e 'while(<>) {s/\n/\r\n/g; print;}' | lpr

you could then setup a shell function in your bashrc file to do this for
you,
to wit:

# Takes only a single file as an argument
# change to cat $* to take all args as files
mylpr()
{

	# this doesn't allow for any options to pass to lpr :-(
	cat $1 | perl -e 'while(<>){s/\n/\r\n/g; print;}' | lpr
}

add this to your ~/.bashrc, say 'exec bash' and then when you say 

mylpr /etc/hosts 

it will apply the filter to /etc/hosts and print it. 

Vincent wrote:
> 
> Adam Lassek wrote:
> >
> > I recently blew away my Red Hat partitions and switched over to SuSE 6.3, but
> > I'm having a problem printing. How do I fix the text stair-stepping problem
> > with the printer driver? I know RedHat fixes this automatically, but I have no
> > idea how to fix it myself.
> >
> > -------------------------------------------------------------------------
> 
> You can either install "printtool" and "printer-config" from your RedHat
> distro and use it or edit /etc/printcap and the files in
> /var/spool/lpd/lp (see `man printcap`).  After taking a glance at them,
> editing the filter appears to be more trouble than it's worth.
> 
> -------------------------------------------------------------------------
> Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/
> To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net`

-- 
* Chad S. Lauritsen, Systems Administrator                       *
* Perfection Learning Corporation                                *
* 1000 North Second Avenue, Logan, IA 51546 712.644.2831 x 223   *
"Out of the overflow of the heart, the mouth speaks." --Jesus

-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list