title: Bash foreach loop works differently when executed from .sh file
body: <p>The following 'oneliner' does what I need:</p>
  
  <pre><code>$ for i in {1..5}; do echo $i; done
  1
  2
  3
  4
  5
  </code></pre>
  
  <p>However, when I place exactly the same code into for-each.sh file and execute it, I get different result. Why?</p>
  
  <p>for-each.sh file:</p>
  
  <pre><code>#!/bin/bash
  for i in {1..10}; do echo $i; done
  </code></pre>
  
  <p>Result after execution:</p>
  
  <pre><code>$ ./for-each.sh
  {1..10}
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Uf. I'm sorry. Now I noticed that I executed the for-each.sh by sh ./for-each.sh command and not by ./for-each.sh. I didn't know the difference between bash, sh, dash, ... After reading <a href="https://stackoverflow.com/a/5725402/915756">stackoverflow.com/a/5725402/915756</a> I realized that I executed the file by dash which points to /bin/sh by default on my Debian machine.</p>