On Tue, May 19, 1998 at 05:39:15AM +1000, bryan.fredrick@pca.state.mn.us
wrote:>I am using samba to share my RedHat V5.0 printers to my MS Network clients,
but
>I get an extra blank page at the end of each print job. I've looked at
the
>printcap man pages, but haven't been successful in getting rid of the
trailing
>blank page.
I solve this problem with text files with a filter that strips all trailing
blank lines off the output. It also strips trailing whitespace on each
line to take care of programs that insist on putting CRLF there causing
double spacing on some printers.
In its simplest form this can be done with a perl script, the main loop of
which would be (check the syntas of the line printing blank lines as I may
have the character and count backwards).
while(<>) {
s/\s+$//; # strip trailing whitespace
unless($_) { # do this if the line's blank
$blanks++;
next;
}
print "\n" x $blanks if $blanks; # print blank lines
$blanks = 0; # reset blank counter
print;
}
Bill
--
INTERNET: bill@Celestial.COM Bill Campbell; Celestial Systems, Inc.
UUCP: camco!bill PO Box 820; 2835 82nd Avenue S.E. S-100
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/