I'm trying to remove the carriage returns (\r
) from a file with the following command on AIX, but it's also removing my last line. Any suggestions?
sed -e 's/\r\n/\n/g' ./excprule > ./excprule.tst
Command sequence:
dev1:> sed -e 's/\r\n/\n/g' ./test_file > ./test_file.tst dev1:> diff test_file.tst test_file diff: 0653-827 Missing newline at the end of file test_file. 26a27 > Trailer 25
Edit: Found a workaround by doing the same thing with perl, but would like to know why this doesn't work.