title: How do I write a loop in a gdb script?
body: <p>After adapting this <a href="https://stackoverflow.com/questions/20481815/how-to-loop-in-a-gdb-script-till-program-is-finished">answer</a>, I wrote the following loop to simply print an array in gdb in a script called "gdb_script.gs". What am I doing wrong?</p>
  
  <pre><code>set $end=64  
  while ($i&lt;$end)
     print $i
     print volfrac($i, :, 1)
     set $i=$i+1
  end
  </code></pre>
  
  <p>where volfrac(:,:,:) is a fortran array. I am getting the error:</p>
  
  <pre><code> gdb_script.gs:14: Error in sourced command file:
   A syntax error in expression, near `&lt;$end)'.
  </code></pre>