The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lpstat throughs warning sagii Shell Programming and Scripting 1 06-24-2009 09:08 PM
Lpstat draco HP-UX 12 09-10-2008 11:22 AM
non root user can't use lpstat checkpro SCO 3 09-10-2008 10:47 AM
lpstat sskb UNIX for Advanced & Expert Users 3 02-21-2003 10:00 AM
lpstat -t stufine UNIX for Dummies Questions & Answers 2 08-06-2002 05:25 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2009
sagii sagii is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 22
lpstat

Hi,
here is lpstat command with queue name. queue name is not valid but lpstat takes my local queue and shows the following results.is there any way that i can stop it after waring message and dont take local print queue. i would like to print a message that queue is not valid but when lpstat creates output like given below i cant print msg because it has valid print queue name xerox and status is READY. i have check on status.please guide me
lpstat -ppfs39p07
qstatus: (WARNING): 0781-102 Invalid printer name: pfs39p07.
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- -----
xerox @DDCM READY
xerox xerox READY

thanks
sagii
  #2 (permalink)  
Old 07-02-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,794
There are no standards for lpstat behavior - mine simply reports an error. Yours seems to do interesting things, so let's investigate before we can answer your question.

Run your lpstat command from the prompt.
Next echo $?
Example

Code:
> lpstat -ppfs39p07
qstatus: (WARNING): 0781-102 Invalid printer name: pfs39p07.
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- 
xerox @DDCM READY
xerox xerox READY 
> echo $?
1

echo $? should produce a non-zero value (return code) on errors or warnings.
Is that what you see?

If that is the case, then you can use $? to have your code ignore any text output.
  #3 (permalink)  
Old 07-02-2009
sagii sagii is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 22
thank jim for giving me idea.it works
  #4 (permalink)  
Old 07-02-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,937
What happens if you put a space between the -p option and the printer name?
  #5 (permalink)  
Old 07-02-2009
sagii sagii is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 22
here is the output with space
lpstat -p pfs39p07
usage: lpstat [-drstW][-aDestination,...][-cClassname,...]
[-oOutRequirement,...][-pPrinter,...][-uUser,...]
[-vPrinter,...] [jobid,...]
Prints LP status information.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0