bt707
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??
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??
'grep -e "rfc822;.*@my.domain.com" some-file' should work.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
grep "*pattern*" willl not work, you need to do:
grep "rfc822" filename(s) | grep "@my.domain.com"
grep "rfc822" filename(s) | grep "@my.domain.com"
ASKER
got it work with the "."
Thanks,
Thanks,