title: Bash script to calculate summarize IP address ranges
body: <p>I need to write a bash script that when I enter two ip addresses, it will calculate summarize address for them.  </p>
  
  <p>Examlpe:  </p>
  
  <pre><code>192.168.1.27/25
  192.168.1.129/25  
  </code></pre>
  
  <p>Result will be:  </p>
  
  <pre><code>192.168.1.0/24  
  </code></pre>
  
  <p>Can you help me with this script?  </p>
  
  <p>I know you will say to me “What did you try?”</p>
  
  <p>I tried to find something in Google, but what I found that I must to convert to binary then calculate it, and it will be very hard.  </p>
  
  <p>I even don’t know how to start with it.</p>
  
  <p>Any idea or hint please?</p>