BASH - Files - DOS2UNIX

Convert all DOS newlines (CR/LF) to UNIX format (CR).

This is the same as converting /r/n to /n.

Works when each line ends with ^M (Ctrl-M). Removes the ^M.

awk '{sub(/\r$/,"");print}' filename