免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1258 | 回复: 0
打印 上一主题 下一主题

Printing Tips for the Solaris Operating System [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-05-29 22:43 |只看该作者 |倒序浏览
Printing Tips for the Solaris Operating System
Printing Tips for the Solaris Operating System
By Carl Grammer
Although it is generally taken for granted, printing can give you
problems if you are new to UNIX or lack the information needed to get
your document to your printer of choice. The following is intended to be
a brief primer on printing from the Solaris environment, so you
will have the information you need. Once you are up to speed, you can go
right back to taking printing for granted. Now, on with a little
printing Q&A.
Frequently Asked Questions
First, how do you submit a job to the printer?
As most of you probably know, at the UNIX prompt you simply type:

lp  [   ...]
Here's an example:
$ lp create2.ksh
request id is 250_mailroom-469 (1 file(s))
Where will it print?
To the default printer.
Which printer is the default printer?
Ah, there's the rub. For any user on a particular system you may have
two or three default printers.

Two or three default printers?! How can you call them
default?

Well, you have the system or global default, and each user can set
his or her own individual default printer.
  
That makes two printers; what is the third?
I'll get to that later.
I still don't know where my file printed!
If you have not set your individual default, the print job will go to
the system default.
OK, this is getting a bit tiresome. How do you determine what the
system default is?

To determine the system's default printer, execute the following at
the UNIX prompt:
lpstat -d
This will return the system or global default printer name. It will
look something like this:
$ lpstat -d
system default destination: 250_mailroom
If there is no system default, you'll see something like this:
$ lpstat -d
no system default destination
How do I set my own default printer?
Use one of two environment variables to tell the lp command which printer to use. The environment variables are as follows:
LPDEST=
or
PRINTER=
lp will look first at LPDEST. If LPDEST is
null, lp will then look at PRINTER. If PRINTER is
also null, the job will go to the system default.
How do I check the status of a print job?
Use the lpstat command again, with no
parameters. The output will be similar to the following:
$ lpstat
250_mailroom-469        grammerc         12008   Dec 07 12:34 on
250_mailroom
This reveals that the print job has been queued up. Small jobs may be
transferred from the print queue on the system to the printer buffer so
quickly that they may not show up using lpstat.
How do I find out what printers are available?
Again, the lpstat command:
lpstat -a
The output will look something like this:
$ lpstat -a
100_training2 accepting requests since Wed Oct 11 13:59:05 CDT 2002
250_mailroom accepting requests since Wed Oct 11 17:58:51 CDT 2002
200_frontdesk accepting requests since Wed Oct 11 17:54:08 CDT 2002
200_mailroom accepting requests since Fri Oct  6 11:28:26 CDT 2002
What if I want to print to a printer other than the
default?

Use the -d parameter on the lp command line to indicate the desired
destination, as in the following example:
lp -d 200_frontdesk
What about this third default you mentioned?
The Solaris OS has its roots in the old BSD UNIX. The BSD printer
command is lpr. The Solaris OS still makes
available many of the BSD utilities, including lpr. Previously I mentioned that the lp command searches for the name of the user's
default printer by first looking at the environment variable LPDEST and then looking at PRINTER. The lpr
command makes use of these same variables but searches them in the
opposite order
. Therefore, if you set these variables to different
printers, you can use lp to print to the
printer specified by LPDEST and use lpr to print to the printer specified by PRINTER.
One thing to note, however: The lpr command doesn't give
you a "warm fuzzy" by returning the request ID, like lp does, but it prints just the same.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7000/showart_28320.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP