grep pattern in a file not working. please help...

Guys, I have my.mrk file as follows:

rs112
rs105
rs154
rs136
...

and my.map file:

7 rs112 0.59
7 rs188 0.63
7 rs105 0.77
7 rs113 0.84
7 rs154 0.92
7 rs111 1.46
7 rs095 1.71
7 rs073 1.90
7 rs136 2.22
7 rs107 2.84
...

I need grep lines in the my.map file according to lines that appear in my.mrk file so to have results like:

7 rs112 0.59
7 rs105 0.77
7 rs154 0.92
 7 rs136 2.22
...

I tried

grep -f my.mrk my.map

but it returns every line in my.map rather than what I wanted. I can't figure out what happens but it used to work on my other machine. My current shell /bin/csh.

Or if there's an alternative way to do the job?

Thanks in advance!

Depending on the Operating System these might work.

grep -F -f my.mrk my.map

fgrep -f my.mrk my.map

Failing that I would carefully check that both files are unix text file format and not MSDOS. Also look for blank lines in file my.mrk which will cause a match with every line in my.map.

These sed's don't change anything but make line terminators visible. A unix format text file should just show lines terminated with a dollar sign.

sed -n l my.mrk
sed -n l my.map

Delete empty blank lines from my.mrk and then try grep

Fantastic! Turns out it is the format difference. This seems a typical problem between unix and msdos txt file. Thanks, guys!