Operating System - HP-UX
1753265 Members
5385 Online
108792 Solutions
New Discussion юеВ

Re: More than one default printer?

 
SOLVED
Go to solution
Chad Holcutt
Occasional Contributor

More than one default printer?

Hi,

Is it possible to define more than one default printer on the system? I would like the default printer to depend on the account. Is there a way to do this?

Thank you,
Chad
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: More than one default printer?

No, there can be but one system-wide default printer for the lp subsystem. However, it is possible to override the default by setting and exporting the LPDEST environment variable and this can be done on a user by user basis. In fact, a good place to set it would be in the users' .profile's.

I should add that if a destination is specified in the lp command that it takes precedence over the LPDEST printer.

Specifically,
if LPDEST=pluto

'echo "Test" | lp -dmickey' would send the output to queue "mickey" whereas 'echo "Test" | lp' would send the output to queue "pluto".

If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: More than one default printer?

You can set an individuals default printer with the PRINTER environment variable.

In their .profile (if using sh or ksh) do:

export PRINTER=

where is the name of the printer you want them to use.
A. Clay Stephenson
Acclaimed Contributor

Re: More than one default printer?

Oh, and if an environment variable "PRINTER" is set, it too will override the default destination but has a lower precedence than LPDEST. By the way, a "man lp" would have told you all of this.
If it ain't broke, I can fix that.
Fern H2O
Frequent Advisor

Re: More than one default printer?

Hey Chad,

Unfortunately You Cannot Have more than one default printer at a time. You can change it exporting the LPDEST variable but then the old default printer will be replaced by the one you choose there.
Steven E. Protter
Exalted Contributor

Re: More than one default printer?

Shalom,

default means one. You can't have two default anythings. Default by dictionary definition and Unix use implies this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chad Holcutt
Occasional Contributor

Re: More than one default printer?

Hi,

Wow! I was on the phone for 5 minutes and the next thing I know I have 5 answers! Defining LPDEST in .profile looks like the way to go.

Thank you,
Chad