Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lpr , lp ??? 1

Status
Not open for further replies.

godi

Technical User
Oct 2, 2006
1
AU
Hye !!

I'm french and i would like to know if it was possible to sender a buffer of characters or a string to the lpr command or lp.
Thanks for the response !!
 
godi,

Hmm... I presume you're doing it from the shell prompt?

Try:

echo "a string of characters" | lp

Annihilannic.
 
If you are wanting to send control codes to the printer, then you will probably want to edit the printer interface script directly. The directly to cd to is:

/usr/spool/lp/admins/lp/interfaces

you will then edit the interface script (usually the name of your printer) and add a line similar to the following towards the beginning of the file:

echo "\033\033\c"

NOTE: The codes that you input MUST be in octal to work and you MUST ALSO end the echo statement with a \c. If not, it won't work.

Have Fun!
Chuck
 
You should NOT edit the files in the /usr/spool/lp/interfaces directory. Instead edit the source files in the /usr/spool/lp/model directory.

Why? Because if you make any changes to the port/baud rate/turn on/off banners etc using scoadmin, the copy in the interface directory is overwritten by the source files in the model directory.

It is also good practice to copy the original model source file to another name and hack that (IE copy /usr/spool/lp/model/epson to /usr/spool/lp/model/epson.mod, hack that and use it as the model in scoadmin). That's so upgrades don't blow your changes away.
 
Remember:

You will only edit the interface files in the model directory if the printer(s) is/are network printer(s). If they are line printers.... they will be in the /usr/spool/lp/admins/lp/interfaces directory.

Regards,
Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top