views:

557

answers:

4

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!

A: 
find . -type f -exec grep $'\r' {} +

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

Chris Jester-Young
A: 

find sourcetree -print0 | xargs -0 file | grep CRLF

DusK
A: 
find . -type f -print | xargs grep 'cntl-M$'

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

Rob Wells
+2  A: 

Based on my answer to another question:

fgrep -rl `echo -ne '\r'` .
CesarB
This is exactly what I needed, justs lists the file names. Thanks!
mikelong