title: Replace newline with string in sed on mac
body: <p>In a file, I need to replace all newlines (not the escape sequence '\n', but the actual newline) with a string. All the questions I've found on SO have been the other way around; i.e. replacing a string with a literal newline. This is on a Mac.</p>
  
  <p>I've tried the following </p>
  
  <pre><code>sed -i '' 's/\
  /STOP/g' file.txt
  </code></pre>
  
  <p>But it gives me an "unterminated substitute pattern" error.</p>