title: Using BASH, how can I expand PDSH list of IP addresses?
body: <p>I have a list of 3000 or so IP addresses that were the result of a pdsh output piped through <code>dshback -c</code> which formats the output into a readable format. I like the readability of <code>dshback -c</code>, but the problem I have is that IP's with common octets are collapsed to save space. I need to have the full IP address for the rest of my project.</p>
  
  <p>Is there an easy way to convert this input:</p>
  
  <pre><code>192.168.38.[217,222],192.168.40.215,192.168.41.[219-222]
  </code></pre>
  
  <p>to this output:</p>
  
  <pre><code>192.168.38.217,192.168.38.222,192.168.40.215,192.168.41.219,192.168.41.220,192.168.41.221,192.168.41.222
  </code></pre>
  
  <p>I was thinking sed could be used directly, but I'm not sure how to store the common octets in a variable. For this reason, I believe a bash script will need to be used along with sed. Any help or points in the right direction would be appreciated.</p>