title: Insert file names into files using find and sed
body: <p>I have hundreds .htm files and i need to replace <code>&lt;title&gt;sometext&lt;/title&gt;</code> with the actual file name.
  For example:
  i have file called <code>records-england.htm</code> and i need to replace <code>&lt;title&gt;sometext&lt;/title&gt;</code> in this file with file name like so <code>&lt;title&gt;records-england.htm&lt;/title&gt;</code></p>
  
  <p>Even better if without extension - but that does not matter.
  I'v tried like this but it's not working:</p>
  
  <pre><code>find . -name *.htm | while read file; do sed "s|&lt;title&gt;sometext&lt;/title&gt;|&lt;title&gt;$file&lt;/title&gt;|g" {} \; done
  </code></pre>
  
  <p>Any advice?</p>