title: How to check if the sed command replaced some string?
body: <p>This command replaces the old string with the new one if the one exists.</p>
  
  <pre><code>sed "s/$OLD/$NEW/g" "$source_filename" &gt; $dest_filename
  </code></pre>
  
  <p>How can I check if the replacement happened ? (or how many times happened ?)</p>