Results 1 to 4 of 4
Can someone help me with my grep command?
I need to match ANYTHING with a wild card to match any pathern. I played with regex but couldnt get it it ...
- 12-10-2010 #1Just Joined!
- Join Date
- Jan 2005
- Location
- Toronto, Canada
- Posts
- 7
grep help
Can someone help me with my grep command?
I need to match ANYTHING with a wild card to match any pathern. I played with regex but couldnt get it it work.
grep "Delivery of nonspam" mail | grep "to ANYTHING#harper" | more
Thank you
- 12-10-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
grep/egrep use regex expressions for pattern matchine. In your example, try this:
Code:# note the use of -i to force grep to be case-insensitive # also not the use of single quotes so the shell doesn't expand the wild-cards grep -i 'delivery of nonspam' mail | grep -i 'to .*#harper' | less
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-10-2010 #3Just Joined!
- Join Date
- Jan 2005
- Location
- Toronto, Canada
- Posts
- 7
- 12-19-2010 #4Just Joined!
- Join Date
- Dec 2010
- Posts
- 16
there's a website only about regex and its very amazing. I learnd alot with it, take a look: regular-expressions.info


Reply With Quote
