title: Simple math statements in bash in a for loop
body: <p>I'm quite new to bash scripting and usually avoid it all costs but I need to write a bash script to execute some simple things on a remote cluster. I'm having problems with a for loop that does the following:</p>
  
  <pre><code>for i in {1..20}
  do
      for j in {1..20}
      do
          echo (i*i + j*j ) **.5  &lt;--- Pseudo code!
      done
  done
  </code></pre>
  
  <p>Can you help me with this simple math? I've thrown <code>$</code>'s everywhere and can't write it properly. If you could help me understand how variables are named/assigned in bash for loops and the limitations of bash math interpretation (how do you do the square root?) I'd be very grateful. Thanks!</p>