Hello,
I am trying to write a ksh script to search text files for carrige returns (\r) and line feeds (\n). I need to find the lines have \r\n versus the lines that have just \n. I know that I can run dos2unix to clean up the file but I want to know beforehand what lines this is going to effect. I have tried using grep \r foo.foo but it is just returning everything in the foo.foo file. I know that foo.foo has some lines that have \r\n and some that have just \n (by looking at foo.foo with od -c). I have also tried grep \\r foo.foo and get the same results. It seems like it should be a straight forward thing to do but it has my whole team stumped.
Thanks for the help.
I am trying to write a ksh script to search text files for carrige returns (\r) and line feeds (\n). I need to find the lines have \r\n versus the lines that have just \n. I know that I can run dos2unix to clean up the file but I want to know beforehand what lines this is going to effect. I have tried using grep \r foo.foo but it is just returning everything in the foo.foo file. I know that foo.foo has some lines that have \r\n and some that have just \n (by looking at foo.foo with od -c). I have also tried grep \\r foo.foo and get the same results. It seems like it should be a straight forward thing to do but it has my whole team stumped.
Thanks for the help.