Is there a quick way to detect the EOL for a file?
I normally just open up the file in Vim and check out the status line. I'm sure there's a better and quicker way.
I figured a grep might work, but I am not sure if it's the most elegant way to detect the EOLs. I'm specifically focused on detecting the Mac EOL (CR), Windows (CRLF) and Unix (LF).
A a *nix/Bash solution is preferred, but I am interested in other platforms as well.
(Earlier, I answered a Server Fault question that could possibly be an EOL issue, and it got me wondering if there was a quick way.)
(\r|\n|\r\n), but like you say, that's not very elegant. – Phoshi Oct 24 '10 at 22:07