in reply to grep and find file weirdness
$ find /tmp/rja/find_test -type f -print0 | perl -0 -ne 'chomp; $t=do{local $/; open(T,"<",$_);<T>}; print "$_ is completely CRLF\n" unless ( $t =~ /(?<!\r)\n/ )'
But then, I've never been a fan of File::Find, ever. It's just too weird and too slow.
BTW, are you looking for files that are completely CRLF, as I assumed in my snippet, or rather for files that have any CRLF in them? If the latter, the last part of the snippet would be if ( $t =~ /\r\n/ ) update: and I'd change "is completely" to "has".
|
|---|