Issue
So i just started to learn about grep and i tried to use it on WSL Ubuntu. but some grep commands give no output like the line - grep '123$' sampledata.txt - doesn't provide any output. when i tried this on my Azure vm it works fine. is anyone else facing this issue and is there someway to fix this.
Thank you.
Solution
You can remove the CR symbols that come at the end of lines first:
grep '123$' < <(sed 's/\r$//g' sampledata.txt)
In Windows, lines have CRLF endings, in Linux, there are LF endings.
Answered By - Wiktor Stribiżew Answer Checked By - Clifford M. (WPSolving Volunteer)