Link to home
Start Free TrialLog in
Avatar of bt707
bt707Flag for United States of America

asked on

find grep search-----string

what is the best way to find a string that has a string in it but one of the words change in it, can't seem to find the right wildcard to use.

Ex:

need to find a sting line this:    rfc822;smith@my.domain.com

I want to find this sting but in this case take the word smith out and use a wild card in it's place to find any string that fits this with any user name that is before the @ in this string. I usally use grep but maybe i could do it better with find??
Avatar of jlevie
jlevie

'grep -e "rfc822;.*@my.domain.com" some-file' should work.
Avatar of bt707

ASKER

I already tried with using the * in place of that word  but gives me nothing? that what I can't figure out.
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yuzh
grep "*pattern*" willl not work, you need to do:

grep "rfc822" filename(s) | grep "@my.domain.com"

Avatar of bt707

ASKER

got it work with the "."

Thanks,