1834939 Members
2151 Online
110071 Solutions
New Discussion

Printing to console

 
Pocius Arturas
Advisor

Printing to console

How can I print to console (700/60) attached printer from shell script and cron job?

Thanks.

Arturas Pocius
2 REPLIES 2
Stefan Schulz
Honored Contributor

Re: Printing to console

Hi,

if you want to print to the console just redirect your output to /dev/console. If you have a printer attached you should be able to redirect your output there. Something like:

echo "This is a test" > /dev/ttynn

Set the device according to the device your printer is connected to.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Carlos Fernandez Riera
Honored Contributor

Re: Printing to console

I guess you like a transparent printing, so you can use the console while cron print to console printer...


Read the console guide and look for scape commands ...

In a ansi terminal ( your is configured as vt100 or hp) you must send the scape secuence

\E[5i to start sending to attached printer and \E[4i to stop it.

So if you send \E[5i this message goes to printer \E[4i to the terminal it will be write to the printer not to screen.

You must find this secuences for vt100 or hp. Dont know if CTRL-R and CTRL-T will work.


\E stands for scape ( 0x1b)
unsupported