title: Delete last blank line from a file and save the file
body: <p>How can I delete the last line of a file without reading the entire file or rewriting it in any temp file? I tried to use <code>sed</code> but it reads the entire file into memory which is not feasible.</p>
  <p>I want to remove the blank line from the end and save the change to the same file.</p>
  <p>Since the file is very big and reading through the complete file would be slow, I am looking for a better way.</p>