Results 1 to 5 of 5

Thread: grep returns odd results based on EOL

Threaded View

  1. #1
    Join Date
    Jun 2008
    Beans
    44

    Cool 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:

    ThisIsMySearchString
    THISISMYTESTINGSTRING

    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

    THISISMYTESTINGSTRINGchString

    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.
    Attached Files Attached Files

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •