- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- egrep question
Operating System - Linux
1752798
Members
5908
Online
108789
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
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
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
тАО02-20-2009 03:08 PM
тАО02-20-2009 03:08 PM
egrep question
I want to egrep for certain fields which are not existing in the current log files and am getting errors for that...
egrep "'^20090220.14'|'^20090220.15'|'^20090220.16'|'^20090220.17'|'^20090220.18'"
Some of the times are in future and logs don't have those entries and I get errors for them ... what should I do?
Thanks,
Allan
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 08:24 PM
тАО02-20-2009 08:24 PM
Re: egrep question
> what should I do?
First, show an actual command with its actual
output. "I get errors" is not a useful
description of what you did, nor of what
happened when you did it.
First, show an actual command with its actual
output. "I get errors" is not a useful
description of what you did, nor of what
happened when you did it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2009 07:57 AM
тАО02-21-2009 07:57 AM
Re: egrep question
>I want to egrep for certain fields
Why not use just grep?
grep -e "'^20090220.14'" -e "'^20090220.15'" ...
Any reason you have single quotes inside of double? This will hide the "^" if you intend to anchor at the start of the line:
grep -e "^20090220.14" -e "^20090220.15" ...
>which are not existing in the current log files and am getting errors for that
If they don't exist, you can't find them. What grep errors would you get?
Why not use just grep?
grep -e "'^20090220.14'" -e "'^20090220.15'" ...
Any reason you have single quotes inside of double? This will hide the "^" if you intend to anchor at the start of the line:
grep -e "^20090220.14" -e "^20090220.15" ...
>which are not existing in the current log files and am getting errors for that
If they don't exist, you can't find them. What grep errors would you get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 04:18 AM
тАО03-02-2009 04:18 AM
Re: egrep question
Why not just do it like this?
egrep "^20090220\.1[4-8]" file.txt
Seems like a mess to make several "or"-statements for this.
Also, the quotation seems unneccessery as Dennis pointed out.
And you should assign some points to those who answered a week ago.
Best regards
Fredrik Eriksson
egrep "^20090220\.1[4-8]" file.txt
Seems like a mess to make several "or"-statements for this.
Also, the quotation seems unneccessery as Dennis pointed out.
And you should assign some points to those who answered a week ago.
Best regards
Fredrik Eriksson
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