Jump to content

Question about grep or qgrep for windows


Nomen

Recommended Posts

I have both grep and qgrep on my win-7 system (and qgrep on my win-98 system) and generally I can get it to do what I want.  But a current task is really p***ing me off.

I want to extract from my router's log files all lines that contain "SRC=18."

I don't want lines that contain "SRC=186.43.what-ever".  Just the lines where the first octet is 18.  not 185 or 189, etc.

My command line is [qgrep -e "SRC=18." *.log > out.txt]

But my output always includes 18n. and 18.  It's as if the "." is being completely ignored in the search string.  It doesn't matter if I put the search string in quotes or not.

Any ideas?

Edit:  see also https://stackoverflow.com/questions/10346816/using-grep-to-search-for-a-string-that-has-a-dot-in-it

:-(

Edit:  Ok, all I needed to do was put the period inside square brackets.  Don't need to put quotes around the whole thing either.

 

Edited by Nomen
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...