title: Replacing text strings within a set of files
body: <p>I am wondering how Bash can solve the next exercise. I have a set of config files in one directory where some IP addresses pointed out. E.g:</p>
  
  <p><code>conf1.txt</code>:</p>
  
  <pre><code>ip-addr: 192.168.1.2;
  mask...;
  gateway...;
  another ip-addr: 192.168.1.5;
  one more ip-addr: 192.168.1.10;
  ... 
  </code></pre>
  
  <p><code>conf2.txt</code>:</p>
  
  <pre><code>ip-addr: 192.168.1.2;
  mask...;
  gateway...;
  another ip-addr: 192.168.1.5;
  one more ip-addr: 192.168.1.10;
  ...
  </code></pre>
  
  <p>And the question is: How can I change all IP addresses with another pool of IP addresses (192.168.1.100-192.168.1.254) but in all files. So for example:</p>
  
  <ul>
  <li>192.168.1.2 -> 192.168.1.100</li>
  <li>192.168.1.5 -> 192.168.1.101</li>
  <li>192.168.1.10 ->192.168.1.102</li>
  </ul>
  
  <p>I suppose that there is some mechanism of assigning values from one array to another because hardcoded version like:</p>
  
  <pre><code> sed "s/192.168.1.2/192.168.1.100/g"; 
  </code></pre>
  
  <p>Isn't good.</p>