Operating System - Linux
1830241 Members
4010 Online
109999 Solutions
New Discussion

Re: How to Create a Filtered Text File from lpstat Command

 
george_114
Advisor

How to Create a Filtered Text File from lpstat Command

I have done those steps below:
#lpstat > x
How to make script that can produce xl that has content job and files that has Rank/Satus Error and active.For example:
#more xl
579 ERROR:job removal requested
720 S031118032493

Thanks in advance for your help.
3 REPLIES 3
Stuart Browne
Honored Contributor

Re: How to Create a Filtered Text File from lpstat Command

I'm not entirely certain as to what you're trying to do, but I will say that 'grep' is your friend.

It appears like simple string pattern matchnig is what you are after. This is what 'grep' is for.
One long-haired git at your service...
george_114
Advisor

Re: How to Create a Filtered Text File from lpstat Command

Sorry ...I forget to attach x textfile..
Stuart Browne
Honored Contributor

Re: How to Create a Filtered Text File from lpstat Command

Well, having a quick look at one of our servers, all I can suggest is this:

lpstat -o | grep ERROR

The resulting output will be only the errors.
One long-haired git at your service...