grep returns odd results based on EOL
I'm doing some file manipulation which requires using grep to handle files. For some reason, grep returns strange results with Mac format text end of line (EOL) characters (CR). Grep works okay for me as long as the end of line is given with a line feed (LF), but not with carriage returns only.
The idea is this:
if I use grep to locate the string 'Search', it should return the name of the file and the line in which it is found. Instead, the CR file (testing2) returns
in the command line interface.
What's more, when I use redirection to output the results of the command, I GET A DIFFERENT RESULT!
Any help would be appreciated.
Tags for this Thread