title: mimic -i flag in sed when -i not available
body: <p>I am trying to mimic the <code>-i</code> flag in <code>sed</code> when <code>-i</code> throws an error, saying it is not available.
  Evidently the server I connected to has an ancient version of <code>sed</code> or a version without the <code>-i</code> flag.</p>
  
  <p>How would one mimic the edit in place <code>-i</code> of <code>sed</code> if it were unavailable?</p>