Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Command line to print a page in Unix

0 views
Skip to first unread message

tra...@gmail.com

unread,
Jan 5, 2006, 11:55:21 AM1/5/06
to
Guys,

Its been a while that I work in a unix environment.

I want to create a text file in pico or vi (just a test page). Whats
the command for me to use to print that test page if my device is
called lp_printer1?

I would like to use this to troubleshot comunnications of serial
printers and such.

Btw, this is SCO Unix 5.


Thanks,
Tony

Ted Nolan <Ted.Nolan>

unread,
Jan 5, 2006, 12:48:35 PM1/5/06
to
In article <1136480121.0...@o13g2000cwo.googlegroups.com>,

Hmm, assuming "Unix 5" means it has some System V influence, try:

lp -d lp_printer1 testpage

If there's any BSD in the lineage try

lpr -Plp_printer1 testpage

At any rate, try "man lp" and "man lpr"


Ted

Ángel

unread,
Jan 5, 2006, 12:59:07 PM1/5/06
to
tra...@gmail.com wrote:
> I want to create a text file in pico or vi (just a test page). Whats
> the command for me to use to print that test page if my device is
> called lp_printer1?

Try 'man lpr'.

--
Saludos,
Ángel

tra...@gmail.com

unread,
Jan 5, 2006, 4:39:46 PM1/5/06
to
Ted,

Thanks for replying.

Do I have to specify where the drivers/printers path?


Thanks,
Tony

Dave Hinz

unread,
Jan 5, 2006, 4:59:16 PM1/5/06
to
On 5 Jan 2006 13:39:46 -0800, tra...@gmail.com <tra...@gmail.com> wrote:
> Ted,
>
> Thanks for replying.
>
> Do I have to specify where the drivers/printers path?

Not if you know the name of the printer or printqueue, which you seem
to. man lp, or man lpr, and read the examples in the one which is
appropriate to your SCO box.

Doug Freyburger

unread,
Jan 5, 2006, 5:25:11 PM1/5/06
to
tra...@gmail.com wrote:
>
> I want to create a text file in pico or vi (just a test page). Whats
> the command for me to use to print that test page if my device is
> called lp_printer1?
>
> I would like to use this to troubleshot comunnications of serial
> printers and such.
>
> Btw, this is SCO Unix 5.

Usually with a test page you want to send it directly to the printer
not through the queueing system. Doing that is consistant with
trying to troubleshot the serial line rather than the software. Note
that you better put a form feed as the last character of your text
file if you're not using the print spooler to do that for you.

Then something like "nohup cat text.txt > /dev/lp_printer1 &".

You want to run it in background and have it hang out while
you're thinking, whence the nohup and &. You want to avoid the
spooler, whence the cat. (If this assumption is wrong see the
other message in the thread not this one.

The trouble is the serial line likely isn't named /dev/lp_printer1.
Maybe "lpstat -t" will tell you the device name for the queue?
Problem is that queue isn't necessarily pointed to the correct
device. Look around in /dev/ for *tty* *cu* and such.

Tonagon

unread,
Jan 6, 2006, 9:22:09 AM1/6/06
to
If it is a network printer and you just want to test the printer then
there is a built in capability for that as well.
Assuming you have the printer working then it was likely setup in
Scoadmin, Printers, HP Network Printer Manager. You can get to this
from the desktop from within the System Administration folder, or from
command line by typing scoadmin.

>From HP Network Print Manager you get a menu of choices, #5 is Verify
network printer operation. All you need to know is the name or IP
address of the printer. It then lets you send a test file, a
PostScript file or a HP-GL/2 file to the printer. One of them is a
picture of a jet.

If it is a local printer off the parallel port then creating a file and
using the lp commands will test it, you can also redirect data to the
port, but that is just a way of troubleshooting problems with it.

By default any print errors are sent to the mail of the user sending
the print job.

Also, typing:
lpstat -t
Gives you a nice breakdown of your printers and their status as well as
any pending print jobs etc.
That should help get you into the swing of things.
Have fun!

Tony

tra...@gmail.com

unread,
Jan 9, 2006, 11:19:39 AM1/9/06
to
Tonagon,

You know alot of about printing. I recalled working with HP Print
Manager a while back too when you mention #5 (Verify)-hehe.

Anyways, is it possible to set up a laser printer through Unix and have
it print color. I am haven't seen the system, but an uncle asked me
that with not too much facts.


Thanks,
Tony

tra...@gmail.com

unread,
Jan 9, 2006, 11:30:42 AM1/9/06
to
Guys,

Also, can you elaborate what "Note that you better put a form feed as


the last character of your text
file if you're not using the print spooler to do that for you. "

What does form feed character look like in a pico file (text).

Thanks a lot guys. I am a newbie here.

Tony

tra...@gmail.com

unread,
Jan 9, 2006, 11:57:58 AM1/9/06
to

Guys,

I did a lpstat -t and it shows part of the following.

device for letter: /dev/tty02
device for PTICKETS: /dev/ttya07

So if I need to test a print I can use the following?


lp -d /dev/ttya02 testpage

nohup cat testpage /dev/ttya02 & (passing the spooler)


thanks,
Tony

Tonagon

unread,
Jan 11, 2006, 10:35:20 AM1/11/06
to
Strange thing, I have never had the occasion to print a color doc from
SCO. I also have no access to a color printer to here at work with
which to test.
But I am sure the answer is yes. I just opened up google in Netscape
that came installed with SCO and printed the web page from there, one
of the print options is Greyscale of color and color is selected by
default. When I printed it appears to have sent color (but since my
printer is black and white and printed it up greyscale I cannot swear
to it). So it looks like you do not have to do anything special in
order to get it to print color, just have a color printer.

Tonagon

unread,
Jan 12, 2006, 8:23:11 AM1/12/06
to
Crud, me and my lousy typing. That was supposed to say "Greyscale OR
0 new messages