bt707
asked on
Search for string Grep
Problem with searching for a string.
EX:
when i do a search such as grep keyword1.keyword2.keyword3 filetosearch
I want to get only lines that match that exact string but i get all lines that match that and any part of the string.
I've also tried grep 'keyword1.keyword2.keyword 3' filetosearch and grep "keyword1.keyword2.keyword 3" filetosearch
but same results each way.
How can i tell grep to ONLY give me the exact quote and nothing else.
Thanks,
EX:
when i do a search such as grep keyword1.keyword2.keyword3
I want to get only lines that match that exact string but i get all lines that match that and any part of the string.
I've also tried grep 'keyword1.keyword2.keyword
but same results each way.
How can i tell grep to ONLY give me the exact quote and nothing else.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
grep "^keyword1.keyword2.keywor d3$"
ASKER
Hello again Sunnycoder,
It is working now, guess i was in a hurry when i did the escape, put in the wrong slash, got it now.
Thanks,
It is working now, guess i was in a hurry when i did the escape, put in the wrong slash, got it now.
Thanks,
ASKER
forgot to put in, i did try to escape the . but still get same thing, not sure what version of grep, it is a new server with fresh intall of solaris 8
Thanks,