I have been trying to remove empty lines and lines just filled with spaces. I have used the following command which does work.
sed -i "/^\s*$/d"
Except it leaves one single trailing line at the very end of the file. For the life of me I cant figure out why I cant remove that last trailing line. It appears to be a line feed character as the hex code is "0A".
Anyone have any ideas how to remove it? I don't care if I need to run a second command after my first SED command to get rid of it.