I'd like to know if a file uses LF or CRLF line endings. I'm on Windows with vim installed. I don't want to convert the files, just know which line endings they use.
I know I can get the file format (
unix) used by running
:set ff?, but I can't find a way to have the result printed on standard output.
:echo doesn't print anything on stdout.
I tried using scripted ex mode:
vim -e -s myfile < ../script.vim
The output contains the first line of
myfile, so the
1p command is executed, but I can't see the result from
echo ff?. What's the right command to output something?