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,504
  • 2
  • 34
  • 38
  • 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
  • 41,901
  • 7
  • 59
  • 86
0
find . -type f -exec grep $'\r' {} +

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

Chris Jester-Young
  • 213,251
  • 44
  • 377
  • 423
0
find . -type f -print | xargs grep 'cntl-M$'

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

Rob Wells
  • 35,340
  • 13
  • 80
  • 146