When I run grep on a text file, I get nonsense results. It seems as if the whole file is printed out but on one line overwriting itself. I read that on the Mac, text files use \r instead of the normal \n as a line ending. That would explain it, but how to make grep treat \r as if it were \n?
I'm using Snow Leopard OS X, and am quite new to using Apple anything, but a long-time Linux programmer.