title: How can I expand a range in a string in bash?
body: <p>In bash how can I expand the range in a string var so I can use it in a for loop ?</p>
  
  <pre><code>num=9999999X
  num=`echo $num | sed 's/X/\{1..9\}/g'`
  echo $num #  outputs 9999999{1..9}
  echo ${num} #  outputs 9999999{1..9}
  echo 9999999{1..9} #outputs 99999991 99999992 99999993 99999994 99999995 99999996 99999997 99999998 99999999
  for i in $num
  do 
          echo $i
  
  done #  outputs 9999999{1..9}
  </code></pre>
  
  <p>what I want is to loop through the numbers so I can echo one at each line.</p>