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

How do I set default printers?

4 views
Skip to first unread message

jmt

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
Running SCO OSR5 5.0.5.

I have several printer defined and always print to the default printer. How
would I change the default printer to one of the other ones?

Appreciate any help on this.

Thank,
Jeff


John Salfer

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
For system wide:

/usr/lib/lpadmin -d PRINTER_NAME
or
scoadmin printer, select your printer and use the menu options Printer/Set
to default.

Verify the change by lpstat -d

For user only:
set LPDEST in your .profile

LPDEST=printer1 ; export LPDEST

John.


jmt <jmt...@hotmail.com> wrote in message
news:nYhO4.9849$9A6....@typhoon.tampabay.rr.com...

Ryder Brooks

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
The quickest way would be :

/usr/lib/lpadmin -d printername


-Ryder

jmt

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
Great, yea! Could I to the export at the command line instead of the user's
.profile instead? If so, How can I do this same way? BTW, there is only 1
user to begin with.

Thanks so much.

Jeff


"John Salfer" <jo...@voyageursw.com> wrote in message
news:tqiO4.2473$wJ1....@ptah.visi.com...


> For system wide:
>
> /usr/lib/lpadmin -d PRINTER_NAME
> or
> scoadmin printer, select your printer and use the menu options Printer/Set
> to default.
>
> Verify the change by lpstat -d
>
> For user only:
> set LPDEST in your .profile
>
> LPDEST=printer1 ; export LPDEST
>
> John.
>
>

jmt

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
Thankyou!

Jeff

"Ryder Brooks" <ry...@sco.com> wrote in message
news:8ecbq6$9sc$1...@avon.europe.sco.com...


> The quickest way would be :
>
> /usr/lib/lpadmin -d printername
>
>
> -Ryder
>

jmt

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
I forgotten to mention if the running application has the printer name
hardcoded into there application to which printer to print to, how can I
change that printer? I know what the printer name is, just need to redirect
there print job to another printer name.

Thanks again,
Jeff

Jeff Liebermann

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
On Fri, 28 Apr 2000 17:18:22 GMT, "jmt" <jmt...@hotmail.com> wrote:

>I forgotten to mention if the running application has the printer name
>hardcoded into there application to which printer to print to, how can I
>change that printer? I know what the printer name is, just need to redirect
>there print job to another printer name.

If your unspecified application has something like:
lp -d printer_name
imbedded in some configuration file, then you're stuck. It takes priority
over $LPDEST and over the print spoolers default printer.

However, I know of no application, written by mortals, that cannot be
twisted into doing what I want it to do. First, find the configuration file
that goes with your unspecified application, and see if you can find the
place where the printer is defined. If it looks like:
lp -d printer_name
then change it to just:
lp
Some really old programs have lpr instead. Same thing.

Once this is done, you can use $LPDEST to define the printer for a specific
user in their .profile.

If your unspecified application truely has the name of the printer compiled
into the application, I would like to know the names of the programmers so I
can borrow the crystal ball they used to pre-devine the names you assigned
to your printers. If your unspecified application happens to be a turn-key
system, where the vendor supplies everything including the printers, then
never mind. They tend to do such things to make their support calls easier.

--
Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060
(831)421-6491 pgr (831)426-1240 fax (831)336-2558 home
http://www.cruzio.com/~jeffl WB6SSY
je...@comix.santa-cruz.ca.us je...@cruzio.com

Ken Wolff

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
At 05:18 PM 4/28/00 +0000, jmt wrote:
>I forgotten to mention if the running application has the printer name
>hardcoded into there application to which printer to print to, how can I
>change that printer? I know what the printer name is, just need to redirect
>there print job to another printer name.
>
>Thanks again,
>Jeff
>
>"jmt" <jmt...@hotmail.com> wrote in message
>news:nYhO4.9849$9A6....@typhoon.tampabay.rr.com...
> > Running SCO OSR5 5.0.5.
> >
> > I have several printer defined and always print to the default printer.
>How
> > would I change the default printer to one of the other ones?
> >
> > Appreciate any help on this.
> >
> > Thank,
> > Jeff
> >
> >
> >

You can setup pseudo printer(s) on your system and use the file
/usr/spool/lp/remote to control where and how the output is actually printed.

For example, if your application prints to 'fakeptr' but you want it to go
to 'realptr' you would configure 'realptr' as you normally word. Then add
'fakeptr' with a device of '/dev/null' and the printer interface of
'network'. Then create /usr/spool/lp/remote with the following:

fakeptr: lp -drealptr {any other 'lp' print options here}

So you could have:

fakeptr: lp -drealptr -oraw

If your application does all of the printer formatting. Otherwise you
could have:

fakeptr: lp -drealptr -olpi8 -oland

If your printer interface understood these options. On a standard Laserjet
this would print 8 lines per inch, landscape, compressed.

You can then change the 'remote' file any time you want the output going
somewhere else.

Ken


Bill Campbell

unread,
Apr 28, 2000, 3:00:00 AM4/28/00
to
On Fri, Apr 28, 2000 at 10:52:04AM -0700, Jeff Liebermann wrote:

>On Fri, 28 Apr 2000 17:18:22 GMT, "jmt" <jmt...@hotmail.com> wrote:
>
>>I forgotten to mention if the running application has the printer name
>>hardcoded into there application to which printer to print to, how can I
>>change that printer? I know what the printer name is, just need to redirect
>>there print job to another printer name.
>
>If your unspecified application has something like:
> lp -d printer_name
>imbedded in some configuration file, then you're stuck. It takes priority
>over $LPDEST and over the print spoolers default printer.
>
>However, I know of no application, written by mortals, that cannot be
>twisted into doing what I want it to do. First, find the configuration file
>that goes with your unspecified application, and see if you can find the
>place where the printer is defined. If it looks like:

I have a system that does exactly that. I have a file, /etc/printers
that has entries mapping logical printer names to real printer names,
and the system on which to print them. The file looks like this:

default laser localhost
laser laser localhost
oldprn printer someotherhost
...

I then have /usr/local/bin/lp that's in the PATH before /usr/bin/lp
and further I move the original /usr/bin/lp to /usr/bin/lp.original,
and link it to /usr/local/bin/lp to make sure that everybody uses it.
My script then reads the /etc/printers file, and maps the printer name
to the real printer. If the printer's local, then it forwards the job
to the local with a pipe to ``/usr/bin/lp.original -ddestination''.
If it's a different system, then it pipes to the remote system using:

"|ssh someotherhost /usr/local/bin/lp @ARGV"

This is in perl so it passes the appropriate arguments to the remote
system's /usr/local/bin/lp program which goes through exactly the same
process. It would even be possible to have the job get in a loop if
each system redirected the job to the other (I suppose this could be
done intentionally if there were a printer problem, breaking the loop
when the printer was working again :-).

Bill
--
INTERNET: bi...@Celestial.COM Bill Campbell; Celestial Systems, Inc.
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

Cutting the space budget really restores my faith in humanity. It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation.
-- Johnny Hart

0 new messages