Very new to UNIX but not new to programming. Using Terminal on MacBook. For the purposes of managing and searching word lists for crossword construction, I'm trying to get handy with the Grep command and its variations. Seems pretty straightforward but getting hung up early on with what I thought should be a simple case.When I enter grep ^COW masternospaces.txtI get what I want: a list of all the words starting with COW.But when I enter grep COW$ masternospaces.txtI expect to get a list of words ending with COW (there are many such words), and nothing is returned at all. The file is a plain text file, with every line just a word (or a word phrase with no spaces) in all caps.Any idea what could be happening here?
Why is the end-of-line $ anchor not working with the grep command, even though the front-of-line ^ anchor is?
grep;newlines