title: Bash Script: options - case: range of multiple numbers
body: <p>I'm working on a script in Linux Bash, with different kinds of options to use.
  Basically, the program is going to ping to the given ip-address.</p>
  
  <p>Now, I want to enable the user to write a range of ip-adresses in the terminal, which the program then will ping.</p>
  
  <p>Fe: bash pingscript 25 - 125</p>
  
  <blockquote>
    <p>the script will then ping all the addresses between 192.168.1.25 and 192.168.1.125.</p>
  </blockquote>
  
  <p>That's not to hard, I just need to write a little case with</p>
  
  <pre><code>[0-9]-[0-9] ) ping (rest of code)
  </code></pre>
  
  <p>Now the problem is: this piece of code will <strong>only enable me to ping numbers of fe. 0 - 9 and not 10 - 25</strong>.</p>
  
  <p>For that I'd need to write:
  [0-9][0-9]-[0-9][0-9] (fe: ping 25 - 50)</p>
  
  <p>But then there's the possibility of having 1 number on one side and 2 on the other: <code>[0-9]-[0-9][0-9] (fe: ping 1 - 25)</code></p>
  
  <p>or: <code>[0-9]-[0-9][0-9][0-9] (fe: ping 1 - 125)</code></p>
  
  <p>and so on... That means there're a lot of possibilities. 
  There's probably another way to write it, but how?</p>
  
  <p>I don't want any letters to be in the arguments, but I can't start with that (loop-through system).</p>