What is the best approach to convert the string containing the range of numbers into numbers itself? This format is used for example in defining the range of pages to print. I define, I want to print these pages "11-14,17,20". Now I need to write the bash script which will change this string into the array of numbers: 11, 12, 13, 14, 17, 20
It should be able to work with string which contain the numbers (even with more digits) and with ',' and '-'.