title: How to iterate the number of arguments in a for loop?
body: <p>I'm new to bash programming, and I'm trying to implement a for loop that iterates the number of arguments. I tried with &quot;$#&quot; or just &quot;for i&quot;, and it didn't work. So, basically, I'm seeking guidance and a way to solve that issue. This is when I execute my script:</p>
  <pre><code>./cat.sh food.sh house.sh tv.sh
  </code></pre>
  <p>In my script:</p>
  <pre><code>#!/bin/bash
  for i in $@
  do
  echo $i
  done
  </code></pre>
  <p>I want to echo</p>
  <pre><code>1
  2
  3
  </code></pre>
  <p>and not</p>
  <pre><code>food.sh
  house.sh
  tv.sh
  </code></pre>