title: syntax error near unexpected token `((' in Sun Solaris Unix
body: <p>I have the following logic in the script Setup.sh.</p>
  
  <pre><code>#!/bin/bash
  
  for ((i = 0 ; i &lt; 5 ; i++))
  do
    echo "Welcome $i times."
  done
  </code></pre>
  
  <p>When I run the script using the command <code>./Setup.sh</code>, I get the error </p>
  
  <pre><code>./Setup.sh: line 3: syntax error near unexpected token `(('
  ./Setup.sh: line 3: `for ((i = 0 ; i &lt; 5 ; i++))'
  </code></pre>
  
  <p>When I run the script using the command sh Setup.sh , I get the error </p>
  
  <pre><code>Setup.sh: syntax error at line 3: `(' unexpected
  </code></pre>
  
  <p>When I run the script logic in Execute BASH Shell Script Online using <a href="http://www.compileonline.com/execute_bash_online.php" rel="nofollow">http://www.compileonline.com/execute_bash_online.php</a>, it executes perfectly and prints the following.</p>
  
  <pre><code>Welcome 0 times.
  Welcome 1 times.
  Welcome 2 times.
  Welcome 3 times.
  Welcome 4 times.
  </code></pre>
  
  <p>Can someone help me understand why I get this error on Sun Solaris Unix machine?</p>