Say I have some arbitrary multi-line text file:
sometext moretext lastline
How can I remove only the last character (the e, not the newline
sed 's/.$//' filename | tee newFilename
This should do your job.