title: to write a shell script to grep IP and show to whom it belongs to?
body: <p>To write a shell script program to grep IP (from the list given) and search the network for the IP whom it belongs to. Then if the IP belongs to vodafone, telstra, airtel, write them in a file separately for each operator.</p>
  
  <p>So i wrote the script should be like :</p>
  
  <pre><code>for ip_address in `cat ip_address_list`;  
  do  
  whois $ip_address | grep 'descr' &gt;&gt; final_result 
  done  
  </code></pre>
  
  <p>the output looks like : </p>
  
  <p>$] whois 62.87.90.54 | grep descr<br>
  descr:          GLOBAL MOBILE OPERATOR<br>
  descr:        AIRTEL-NETWORK<br>
  descr:          VODAFONE-NETWORK  </p>
  
  <p>Can we modify it more ? Can we include IF statement to separate vodafone etc to include them in a file ?</p>
  
  <p>Or pls mention a good script than mine ?</p>
  
  <p>Pls advise !</p>