When you know which files have Windows line endings ( 0x0D 0x0A or \r \n ), what will you do with these files? I suppose you convert them to the end of a Unix line ( 0x0A or \n ). You can convert a file with the end of a Windows line to the end of a Unix line using sed utility, just use the command:
$> sed -i 's/\r//' my_file_with_win_line_endings.txt
You can put it in a script like this:
#!/bin/bash function travers() { for file in $(ls); do if [ -f "${file}" ]; then sed -i 's/\r//' "${file}" elif [ -d "${file}" ]; then cd "${file}" travers cd .. fi done } travers
If you run it from the root directory with the files, at the end you will make sure that all the files end with a Unix line.
1ac0 May 09 '15 at 9:00 2015-05-09 09:00
source share