Solved

grep "expression or expression" file

Posted on 2001-06-13
4
293 Views
Last Modified: 2013-12-26
hi .

I have some kind of desired lines at the log file :
---> Time   17.217us: Receiving preamble on GMII
---> Time   17.585us: Packet Received from port 2
---> Time   13.478us: Sending Pkt on GMII
...
the key words are :

Receiving , Received , Sending

how to write a grep command to get as an expression : "exp1 or exp2 or exp3"

can I do this with larger groups of key words ?

Talmash


0
Comment
Question by:Talmash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
amitpagarwal earned 50 total points
ID: 6185442
you could actually use egrep

egrep "exp1|exp2|exp3" fileName


or use grep in the following manner

grep -e pattern1 -e patter2 ...fileName
0
 
LVL 6

Author Comment

by:Talmash
ID: 6185636
hi .

tnx ,

grep -e pattern1 -e patter2 ...fileName

didn't worked

egrep "exp1|exp2|exp3" fileName

worked just fine .

was -e flag do ?

Talmash
0
 
LVL 5

Expert Comment

by:amitpagarwal
ID: 6185771
i say the -e pattern in teh man page of grep .. i guess only the latest version of grep may be supporting it.

Thanks.
0
 
LVL 6

Author Comment

by:Talmash
ID: 6186013
again ,

tnx

Talmash
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 119
conditional code and condition difference 9 87
tripleUp challenge 7 96
NotAlone Challenge 20 92
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question