TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [TCLUG:7538] printing (lpr/lpd?) problems
A little shorter version.
cat <filename> | sed 's/^L$//g' | lp (or lpr, whichever)
The ^L$ matches with ^L at end of line.
You can put this in a file or an alias, though i just couldn't get the alias
to work on my csh. Somehow alias doesn't let me put the quotes that sed
needs.
-Unni
> -----Original Message-----
> From: Carl Patten [mailto:cpatte@trimodalinc.com]
> Sent: Thursday, August 26, 1999 4:29 PM
> To: tclug-list@mn-linux.org
> Subject: RE: [TCLUG:7538] printing (lpr/lpd?) problems
>
>
> >
> > if I could get it to print to a file; I suppose I
> could try to
> > kludge a sed script to remove the annoying ^L character at
> the end, then
> > print it. this is a bit beyond my understanding, tho...
> >
>
> sed -e "s/^L//g" file1.txt > file2.txt
>
> This will remove all the ^L characters from the print job.
> If you only want
> to remove the one at the end of the print job, the following
> command will
> cut off the last line:
>
> tmpvar=`cat file1.txt|wc -l`; head -n `expr $tmpvar - 1` file1.txt >
> file2.txt
>
> Disclaimer: There are a gazillion people out there who know
> more about shell
> programming than I do and are probably wincing at the inelegance of my
> examples. Nonetheless these should be enough to get you started.
>
> --
> Carl Patten
> Systems Administrator
> Trimodal Inc.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
>