• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

UNIX exam controversy

Andrew111

Senior member
I had a test on UNIX today and there was some controversy with one of the questions. Here's the setup:

We are all logged into the server with our own accounts.

The question is:

Display the status of all printers available for your use and save it to a file called printer.

The instructor said the correct way to get that information would be to do an lpstat -t...but doesn't that display all printers whether your login account can use them or not? I did a regular lpstat.....any UNIX gurus want to chime in with some strong words on what the answer would be?
 
The authentication issue is relevant, but I don't know if there's a way to limit the output that way or not. I try to think about lp as little as possible. But lpstat by itself, at least on my systems, will only display the status of the queue - if there's no queue, then there's no output. So that looks incorrect to me. But perhaps your lpstat behaves differently.
 
Originally posted by: cleverhandle
The authentication issue is relevant, but I don't know if there's a way to limit the output that way or not. I try to think about lp as little as possible. But lpstat by itself, at least on my systems, will only display the status of the queue - if there's no queue, then there's no output. So that looks incorrect to me. But perhaps your lpstat behaves differently.
Ours is setup differently.....the instructor told us how to use the lpstat command and it differed from the UNIX quick reference book we had.

 
Originally posted by: Andrew111
What does the lpstat -t command display?
tppytel@timaeus:~$ lpstat -t
scheduler is running
system default destination: Draft
device for Draft: ipp://aristotle.sophrosune.org:631/printers/Draft
device for Quality: ipp://aristotle.sophrosune.org:631/printers/Quality
Draft accepting requests since Jan 01 00:00
Quality accepting requests since Jan 01 00:00
printer Draft is idle. enabled since Jan 01 00:00
printer Quality is idle. enabled since Jan 01 00:00
Ready to print.


This is the CUPS-ified version of lp, so I wouldn't necessarily expect it to be standard. lpstat -s is what I would use if I just wanted a simple printer listing. I was going by ORA's Unix in a Nutshell also - probably the same as what you have. My BSD boxes don't have lpstat at all. Looks like one of those vendor-specific issues.

edit: formatting
 
Back
Top