title: awk split var twice
body: <p>I would like to split a var twice with awk, this is what i have got so far.</p>
  
  <pre><code>awk -v p=1,3,8,25-27,4-16 '{split(p,t,",");for (i in t) if(t[i] ~ /-/) split(t[i],t1,"-") {print "-dFirstPage=" t1[1] ,"-dFirstPage=" t1[2]} ELSE {print "-dFirstPage=" t[i] ,"-dFirstPage=" t[i]}}' &gt;outfile
  </code></pre>
  
  <p>output shall be</p>
  
  <pre><code>-dFirstPage=1 -dLastPage=1
  -dFirstPage=3 -dLastPage=3
  -dFirstPage=8 -dLastPage=8
  -dFirstPage=25 -dLastPage=27
  -dFirstPage=4 -dLastPage=16
  </code></pre>