title: Changing site-names in a bash script
body: <p>I wan't to run a script that does some file alteration on <code>.php</code> files.
  There are hundreds of <code>EmailController.php</code> files in different sites that should be modified based on the site-name depending on what folder they are located.</p>
  
  <pre><code>#!/bin/bash
  source /root/sitenames.txt
  sed -i 's#'"/var/vmail/skeleton.com/"'#'"/var/vmail/$sitename/"'#g' /var/www/$sitename/web/EmailController.php
  </code></pre>
  
  <p>The easiest way would be to read <code>sitenames.txt</code> file that would contain the domain-names one per line and substitute that domain with <code>$sitename</code> in the bash script.</p>