- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shell scripting help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
04-03-2010 03:01 AM
04-03-2010 03:01 AM
shell scripting help
Iam mid of Shell scripting and Iam looking for command which should NOT capture
"WARN [00000003]" entry from below given log.
2010-04-02T01:57:18,814 WARN [00000003] sas - SAS Object Spawner Daemon III has completed initi
2010-04-02T01:57:18,815 WARN [00000004] sas - SAH021999I Server SAS Object Spawner Daemon III (
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2010 05:19 AM
04-03-2010 05:19 AM
Re: shell scripting help
# grep -v "WARN [00000003]" file
...will output everything from 'file' that does *not* match.
You might use this in cases like this:
# grep "WARN" file|grep -v "WARN [00000003]"
...which would look for all instances of "WARN" in 'file', but skip those matching "WARN [00000003]".
Regards!
...JRF...
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2010 07:23 PM
04-04-2010 07:23 PM
Re: shell scripting help
egrep -v "WARN [00000003]|second_word|3rd_word"
although its lil heavy but quite handy.
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2010 07:47 PM
04-04-2010 07:47 PM
Re: shell scripting help
>although it's lil heavy but quite handy.
Rather than use the egrep hammer, it may be easier to use multiple -e options:
grep -v -e "WARN [00000003]" -e second_word -e 3rd_word
Also since "[" is special to grep, it needs to be quoted or use fgrep instead:
grep -v -e 'WARN \[00000003]'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2010 08:51 PM
04-04-2010 08:51 PM
Re: shell scripting help
you do wish to extract from the file, as well
as what you wish not to extract from it.