Article 57MG1 Command line printing merging files

Command line printing merging files

by
aikempshall
from LinuxQuestions.org on (#57MG1)
Apologies if this is not the right forum to post this question.

I have some documents, in plain text format, that I want to print from the command line using lp, if necessary I could use lpr.

Before printing I have to remove carriage returns.

The command I'm using is

Code:sed ':a;N;$! ba;s/\n//g' $1 | lp -d HP_LaserJet_2300_series -o cpi=14 -o page-left=48 -o page-top=96 FILE_TO_PRINTI also want to print a bespoke header at the top of each page. The header will be several lines and will probably just contain the name of my company. The same lines will appear in each print job. Effectively a bit like printing on pre-printed stationery.
  • Can lpr do this in one pass.
  • Should I do it in two passes.
  • Should I incorporate it into the sed.
  • Should I add another step to append the header to the file just before printing.
  • Or maybe something else.
Alexlatest?d=yIl2AUoC8zA latest?i=R2DPGEqAkEA:5d-TnbyPvgQ:F7zBnMy latest?i=R2DPGEqAkEA:5d-TnbyPvgQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=R2DPGEqAkEA:5d-TnbyPvgQ:gIN9vFwR2DPGEqAkEA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments