|
Home > Archive > Unix administration > January 2006 > Command line to print a page in Unix
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Command line to print a page in Unix
|
|
| tractng@gmail.com 2006-01-05, 6:09 pm |
| 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@brookside.tnolan.com (Ted Nolan 2006-01-05, 6:09 pm |
| In article <1136480121.048311.250030@o13g2000cwo.googlegroups.com>,
<tractng@gmail.com> wrote:
>
>
>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
>
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
| |
|
| tractng@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
| |
| tractng@gmail.com 2006-01-05, 6:09 pm |
| Ted,
Thanks for replying.
Do I have to specify where the drivers/printers path?
Thanks,
Tony
| |
| Dave Hinz 2006-01-05, 6:09 pm |
| On 5 Jan 2006 13:39:46 -0800, tractng@gmail.com <tractng@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 2006-01-05, 6:09 pm |
| tractng@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 2006-01-07, 2:49 am |
| 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
| |
| tractng@gmail.com 2006-01-09, 6:02 pm |
| 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
| |
| tractng@gmail.com 2006-01-09, 6:02 pm |
| 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
| |
| tractng@gmail.com 2006-01-09, 6:02 pm |
|
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 2006-01-13, 10:41 pm |
| 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 2006-01-13, 10:41 pm |
| Crud, me and my lousy typing. That was supposed to say "Greyscale OR
color and color is selected by default".
|
|
|
|
|