title: use of special characters in if statement in bash
body: <p>I'm unfamiliar with bash scripting. I wrote a script check arguments. the code is:</p>
  
  <pre><code>for (( i=1; i&lt;=4; i++ ))
  do
          if ! [[ "$"$i =~ .*[^0-9].* ]]; then
                  echo "bad input was $i"
          fi
  done
  </code></pre>
  
  <p>Actually i want to split non numerical arguments, But it seems that "$"$i is wrong because the answer is always true or false independent of arguments.
  can anybody tell me what is the mistake?</p>