3

Is there a csh script/command to list all the files in source source tree which have line endings that show up as "^M" in emacs (under linux).

Thanks!

mikelong
  • 3,694
  • 2
  • 35
  • 40
  • If you want to easily remove all of these DOS carriage returns, just run "dos2unix" on a file or wildcard. – joelhardi Oct 31 '08 at 10:51

3 Answers3

6

Based on my answer to another question:

fgrep -rl `echo -ne '\r'` .
Community
  • 1
  • 1
CesarB
  • 43,947
  • 7
  • 63
  • 86
0
find . -type f -exec grep $'\r' {} +

The $'\r' probably requires bash to function correctly.

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
0
find . -type f -print | xargs grep 'cntl-M$'

where cntl-M has been entered by first entering cntl-V

Rob Wells
  • 36,220
  • 13
  • 81
  • 146