in reply to Remove ^M using script
linux already has a command "dos2unix" which fixes the line endings.