[unix] How to remove a character at the end of each line in unix