title: What is the difference between "for i" and "for i in 1 2 3 4" in shell scripting?
body: <p>I had to print all the arguments parsed in a shell script on a different line. I wrote a script as </p>
  
  <pre><code>for i in 1 2 3 4 5
  do
     echo $i
  done
  </code></pre>
  
  <p>but this prints </p>
  
  <pre><code>1
  2
  3
  4
  5
  </code></pre>
  
  <p>even if i parse the arguments as "10 20 30 40 50"</p>
  
  <p>and one code on the internet </p>
  
  <pre><code>for i
  do
     echo $i
  done
  </code></pre>
  
  <p>this code prints the arguments correctly. </p>
  
  <p>Can someone explain me why that code works but mine doesn't? </p>
  
  <p>Also how can I use the value of one variable ($i) as the variable name to print something else. like </p>
  
  <pre><code>i=1
  $($i)
  </code></pre>
  
  <p>should print the value of $1.</p>