- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: LPSTAT -U
Operating System - HP-UX
1755639
Members
2911
Online
108837
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 09:25 PM
09-06-2006 09:25 PM
LPSTAT -U
Hi,
I’m trying to build the function of canceling Unix’s print jobs from my application as follows:
From my application, use the lpstat –u command to list out the currently lined-up print jobs (by user) & dump the result onto a text file
Then the application will read the text file to determine the print jobs’ IDs so that these IDs can be displayed out to the end user for selection (to select which Jobs to cancel)
The problem is that in HP-UX 11.23, the results generated by the lpstat –u command are different from HP-UX 11.0 & 11i; the followings are the examples:
In HP-UX 11.0:
# lpstat -uong
axis_p1_pr1-8932 ong priority 0 Aug 21 14:24 on axis_p1_pr1
(standard input) 2726 bytes
axis_p1_pr1-8933 ong priority 0 Aug 21 14:24 on axis_p1_pr1
(standard input) 2726 bytes
In HP-UX 11.23:
# lpstat -uong
cps1_pr4-2 ong priority 0 Aug 21 15:05 on cps1_pr4
(standard input) 2743 bytes
(standard input) 2743 bytes
cps1_pr4-3 ong priority 0 Aug 21 15:05
(standard input) 2742 bytes
printer queue for cps1_pr4
no entries
demo: sending to 128.0.0.3
You can see that in HP-UX 11.0, it only listed out the job ID + another line for the size of the print job; I can just simply take the first line to get the job ID & ignore the second line, take the third line & ignore the fourth line, and soon…!
However, in HP-UX 11.23, it actually listed out more information, like 2 lines for the size of the print job + some other additional detail lines at the end of the listing; this make me hard to determine which is the job ID and which is not, especially when I have more than 1 print jobs lined-up in the spooler! I have tried to use some other options like lpstat & lpstat –o, but they still give me the same additional detail lines!
Thus, I would like to seek for your advice on how to generate a simple list just like what the HP-UX 11.0 does! My e-mail address is kychui@patimas.com
Regards
Chui
I’m trying to build the function of canceling Unix’s print jobs from my application as follows:
From my application, use the lpstat –u command to list out the currently lined-up print jobs (by user) & dump the result onto a text file
Then the application will read the text file to determine the print jobs’ IDs so that these IDs can be displayed out to the end user for selection (to select which Jobs to cancel)
The problem is that in HP-UX 11.23, the results generated by the lpstat –u command are different from HP-UX 11.0 & 11i; the followings are the examples:
In HP-UX 11.0:
# lpstat -uong
axis_p1_pr1-8932 ong priority 0 Aug 21 14:24 on axis_p1_pr1
(standard input) 2726 bytes
axis_p1_pr1-8933 ong priority 0 Aug 21 14:24 on axis_p1_pr1
(standard input) 2726 bytes
In HP-UX 11.23:
# lpstat -uong
cps1_pr4-2 ong priority 0 Aug 21 15:05 on cps1_pr4
(standard input) 2743 bytes
(standard input) 2743 bytes
cps1_pr4-3 ong priority 0 Aug 21 15:05
(standard input) 2742 bytes
printer queue for cps1_pr4
no entries
demo: sending to 128.0.0.3
You can see that in HP-UX 11.0, it only listed out the job ID + another line for the size of the print job; I can just simply take the first line to get the job ID & ignore the second line, take the third line & ignore the fourth line, and soon…!
However, in HP-UX 11.23, it actually listed out more information, like 2 lines for the size of the print job + some other additional detail lines at the end of the listing; this make me hard to determine which is the job ID and which is not, especially when I have more than 1 print jobs lined-up in the spooler! I have tried to use some other options like lpstat & lpstat –o, but they still give me the same additional detail lines!
Thus, I would like to seek for your advice on how to generate a simple list just like what the HP-UX 11.0 does! My e-mail address is kychui@patimas.com
Regards
Chui
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2007 09:20 PM
08-25-2007 09:20 PM
Re: LPSTAT -U
It appears this is a simple matter of scripting. You either can built up a complex state machine in awk or see if you can analyze what lines you do and don't want.
You could remove lines with "bytes". Or better yet only select lines with "-" followed by "priority":
$ lpstat -uong | grep "-.* priority"
If you want only the IDs, you can pipe it to awk:
$ ... | awk '{print $1}'
You do know of course that cancel(1) takes a -u option? (But you said you wanted to give your users a choice.)
You could remove lines with "bytes". Or better yet only select lines with "-" followed by "priority":
$ lpstat -uong | grep "-.* priority"
If you want only the IDs, you can pipe it to awk:
$ ... | awk '{print $1}'
You do know of course that cancel(1) takes a -u option? (But you said you wanted to give your users a choice.)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP