Timeline for Detecting pattern at the end of a line with grep
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 24, 2022 at 0:32 | comment | added | swpalmer | @jordanm Sort of, I confirmed the problem by dumping the hex bytes with 'od -tx1a'. The line separators in that file are /r/n not /n | |
| Jan 23, 2022 at 18:05 | comment | added | jordanm | @swpalmer that means your line doesn't end in a "r", it ends in a blank space after the "r" | |
| Jan 23, 2022 at 3:18 | comment | added | swpalmer | @jordanm Sorry, the issue is with grep not ls. I'm doing "cat list_of_words.txt | grep '^lunar$'" Without the $ I get a list of 5 words: lunar, lunaria, lunarian, lunarians, lunars .. if I add the $ then I expected to get just "lunar" but I get nothing. Using \b instead of $ works. | |
| Jan 23, 2022 at 2:25 | comment | added | jordanm | @swpalmer Only thing I can think is you might need ls -lR on mac, assuming -R doesn't imply -l like it does in linux. The find version is POSIX and should work everywhere. | |
| Jan 23, 2022 at 1:44 | comment | added | swpalmer | This does not work for me on macOS with zsh. Soon as I add the $ I get no matches, when I can see without the $ that I should get a match. ^ works for beginning of the line, but $ doesn't work for EOL | |
| Mar 13, 2018 at 16:11 | comment | added | jordanm | @thebunnyrules "." in regex means one of any character. | |
| Mar 13, 2018 at 15:22 | comment | added | thebunnyrules | I didn't realize the "." needs to be escaped in grep. Is it treated as a wild card? | |
| Nov 2, 2014 at 2:55 | vote | accept | Sopalajo de Arrierez | ||
| Apr 12, 2014 at 23:45 | history | answered | jordanm | CC BY-SA 3.0 |