http://qs1969.pair.com?node_id=527192


in reply to Conversion of unix LF to DOS LF issues

You didn't specify on which system the script is running.

As a bonus, here are more universal versions:

Update: Cleaned up my booboos.