- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need for shell script
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
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
03-28-2006 08:48 AM
03-28-2006 08:48 AM
Need for shell script
Is there a way it can be run through a shell script ( like a case - esac statement with one each for failed, warning , cannot )
egrep -i failed bldlogtest_cur.022306
egrep -i warning bldlogtest_cur.022306
egrep -i cannot bldlogtest_cur.022306
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 08:53 AM
03-28-2006 08:53 AM
Re: Need for shell script
You can specify multiple tokens in one command as:
# grep -i -e failed -e warning -e cannot bidlogtest_cur.022306
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 08:56 AM
03-28-2006 08:56 AM
Re: Need for shell script
patterns in a file to remove expecte chatter.
Or us egrep -v with multiple patterns
egrep -e failed -e warning -e cannot
The output will be a list of the occurences
of the three words.
You could play with IFS to read this line
by line and use case to match each occurance.
I would consider perl for this.
Also look at the 'logcheck' script and see
if it could do what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:15 AM
03-28-2006 09:15 AM
Re: Need for shell script
egrep -e failed -e warning -e cannot bldlogprod.032806
but it gave me output of only cannot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:19 AM
03-28-2006 09:19 AM
Re: Need for shell script
In you original post you explicitly showed a case-insensitve match (-i). Thus, I suggested:
# grep -i -e failed -e warning -e cannot bidlogtest_cur.022306
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:20 AM
03-28-2006 09:20 AM
Re: Need for shell script
giving output of only cannot ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:21 AM
03-28-2006 09:21 AM
Re: Need for shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:27 AM
03-28-2006 09:27 AM
Re: Need for shell script
# egrep -i "failed|warning|cannot" bldlogtest_cur.022306
...as you're looking for failed OR warning OR cannot lines.
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:33 AM
03-28-2006 09:33 AM
Re: Need for shell script
egrep -i -f list bldlogprod.032806
with list containing the following content :
failed
warining
cannot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 09:39 AM
03-28-2006 09:39 AM
Re: Need for shell script
The only reason why egrep finds "cannot" but not "failed" or "warning" lines is because there aren't any. The command's good, but the file that needs parsing doesn't have all the patterns to be matched.
>> egrep -i -e failed -e warning -e cannot bldlogprod.032806
>> giving output of only cannot
cheers!