Hi Maykel, > > This will remove the carriage returns at the end of lines once > > script has finished. > > This not working. Not quit the end file log character "^M" > > > script -f -c '/usr/local/bin/cccam -d' mylogfile.log > > sed -i 's/\r$//' mylogfile.log It works here. $ script -f -c 'seq 3' mylogfile.log Script started, file is mylogfile.log 1 2 3 Script done, file is mylogfile.log $ od -c mylogfile.log | fgrep '\r' 0000140 L I N E S = " 4 0 " ] \n 1 \r \n 0000160 2 \r \n 3 \r \n \n S c r i p t d o $ sed -i 's/\r$//' mylogfile.log $ od -c mylogfile.log | fgrep '\r' $ Does that od(1) pipeline show any carriage returns in mylogfile.log for you after you have run the sed command? What you call `^M', od shows as `\r'. -- Cheers, Ralph.