Sample Header Ad - 728x90

How to test whether a file uses CRLF or LF without modifying it?

110 votes
11 answers
223767 views
I need to periodically run a command that ensures that some _text_ files are kept in Linux mode. Unfortunately dos2unix always modifies the file, which would mess file's and folder's timestamps and cause unnecessary writes. The script I write is in Bash, so I'd prefer answers based on Bash.
Asked by Adam Ryczkowski (5859 rep)
Jun 17, 2013, 04:34 PM
Last activity: Jun 10, 2024, 06:35 AM