Here is the problem.
I am doing a grep on a file. I only want lines where the search string is matched exactly.
command % grep exam filename
filename contents:
line 1)here:is:my:exam:contents
line 2)here:is:yourroblem:example
The problem is that grep will return both lines because it matches all or part of the search string. Lines that conatina both "exam" and "example" are returned. I only want line 1 to be returned, an exact match. I have looked thru the man pages and I don't see any options that will work. I know it can be done. I am also looking into awk. Any ideas????
I am doing a grep on a file. I only want lines where the search string is matched exactly.
command % grep exam filename
filename contents:
line 1)here:is:my:exam:contents
line 2)here:is:yourroblem:example
The problem is that grep will return both lines because it matches all or part of the search string. Lines that conatina both "exam" and "example" are returned. I only want line 1 to be returned, an exact match. I have looked thru the man pages and I don't see any options that will work. I know it can be done. I am also looking into awk. Any ideas????