Sed script command truncating last line
- by C. Ross
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