Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: what is grep command for and condition

by anakin30 (Acolyte)
on Aug 17, 2010 at 15:29 UTC ( #855526=note: print w/ replies, xml ) Need Help??


in reply to Re^3: what is grep command for and condition
in thread OT: what is grep command for and condition

Firstly i'm so sorry to reply you wrongly. yeah my access file doesn't have a line both with MOD and DEL. 17/Aug/2010:14:58:39 +0000 conn=102837 op=0 msgId=13496 - MOD xxxxxxxx 17/Aug/2010:15:27:16 +0000 conn=102837 op=0 msgId=21769 - DEL xxxxxx i just want to grep all the lines with the word "MOD" and "DEL" from the tail command ..can you help me?


Comment on Re^4: what is grep command for and condition
Re^5: what is grep command for and condition
by ikegami (Pope) on Aug 17, 2010 at 15:40 UTC

    Please use <c>...</c> around computer text (data, code, output, etc).

    [17/Aug/2010:14:58:39 +0000] conn=102837 op=0 msgId=13496 - MOD xxxxxx +xx [17/Aug/2010:15:27:16 +0000] conn=102837 op=0 msgId=21769 - DEL xxxxxx

    i just want to grep all the lines with the word "MOD" and "DEL" from the tail command ..can you help me?

    You just said your file had no such line. It sounds like you want to keep all the lines that have the word "MOD" or the word "DEL". You already posted code to do that.

Re^5: what is grep command for and condition
by JavaFan (Canon) on Aug 17, 2010 at 18:08 UTC
    If you don't have any lines that contain both MOD and DEL in your file, then grep MOD | grep DEL not printing anything seems quite correct to me.

    Let me ask it this way, given the file with no lines containing MOD and DEL, which lines do you want to have printed?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://855526]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-11-29 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (203 votes), past polls