title: Replace string got from pipe in a file in command line
body: <p>How can I use <code>sed</code> or <code>tr</code> or <code>replace</code> to replace the string I get from pipe like:</p>
  
  <pre><code>head -n 1 myfile | sed -i 's/'-'/leg/g' new.log
  </code></pre>