title: How to generate string with a char repeated for n times?
body: <p>I can use the following code to generate a string.</p>
  <pre><code>$ awk -e 'BEGIN { for(i=1;i&lt;=10;++i) s = s &quot;x&quot;; print s }'
  xxxxxxxxxx
  </code></pre>
  <p>But its complexity is super-linear wrt the string length.</p>
  <pre><code>$ time awk -e 'BEGIN { for(i=1;i&lt;=10000000;++i) s = s &quot;x&quot; }'
  
  real    0m0.868s
  user    0m0.857s
  sys 0m0.008s
  $ time awk -e 'BEGIN { for(i=1;i&lt;=100000000;++i) s = s &quot;x&quot; }'
  
  real    0m9.886s
  user    0m9.801s
  sys 0m0.065s
  $ time awk -e 'BEGIN { for(i=1;i&lt;=1000000000;++i) s = s &quot;x&quot; }'
  
  real    1m46.074s
  user    1m45.171s
  sys 0m0.760s
  </code></pre>
  <p>Is there a better way to repeat a char n times and assign the result to a variable?</p>