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