Cannot dd the last line
sacherus opened this issue · comments
Hi,
I want to dd on the last line. After typing dd last line is not going to be deleted.
To remove the last line, you would have to remove the end of line character from the previous line. Also, all the empty lines end in an end of line character except the last line since it's the end of the file.
Some text editors may not even read the last line if the last end of line character is missing. So removing the last line isn't recommended.
And actually if you remove that last line and open it up in vim, vim will insert that end of line character automatically for you when you press save. Then you'll be back to where you started again, with a new line at the end of your file.
Also, it is considered good practice to have an empty line at the end of your file.
http://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
http://stackoverflow.com/questions/9768139/pep8-conflict-between-w292-and-w391