sed 's/.$//' # Assumes that all lines end with CR/LF. sed 's/^M$//' # In bash/tcsh, press Ctrl-V then Ctrl-M. sed 's/\x0D$//' # gsed 3.02.80, but top script is easier.
NOTE: Cannot be done with DOS versions of sed.
Use “tr” instead.
tr -d \r <infile >outfile # GNU tr version 1.22 or higher