How to remove multiple newlines at EOF?
I have files that end in one or more newlines and should end in only one newline. How can I do that with Bash/Unix/GNU tools?
I have files that end in one or more newlines and should end in only one newline. How can I do that with Bash/Unix/GNU tools?
The program ed, a minimal text editor, cannot be exited by sending it an interrupt through using Ctrl–C, instead printing the error message “?” to the console. Why doesn’t ed just exit when it receives the interrupt? Surely there’s no reason why a cryptic error message is more useful here than just exiting. This behavior leads many new users into the following sort of interaction: