• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

Printing Tips for the Solaris Operating System

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: Blog.ChinaUnix.net

软件测试论坛讨论

领测软件测试网

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 <file_name> [ <file_name2> <file_name3> ...]

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=<printer name>
or
PRINTER=<printer name>
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 <file_name>

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.

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网