title: Sed is not working with sh -c in remote server
body: <p>I have a requirement where I need to replace line feed characters appearing as part of a data field in a CSV files. Fortunately all the unnecessary linefeeds are followed by an '_' character. So I decided to used sed to preprocess the file. The following command in sed works if run it interactively.</p>
  
  <pre><code>sed -i -e ':a;N;$!ba;s/\n_/_/g' file
  </code></pre>
  
  <p>But in server, the command will get executed with <code>sh -c "&lt;command&gt;"</code></p>
  
  <p>To test it in local, I ran the same command with sh and it is not working. The command looks as follows.</p>
  
  <pre><code>sh -c "sed -i -e ':a;N;$!ba;s/\n_/_/g' file"
  </code></pre>
  
  <p>Not sure what I'm missing. Please help.</p>