title: How do i print arguments in reverse order in shell script?
body: <p>I was trying to write a script that print the arguments in reverse order.
  So if I type bash reverse.sh one two three 
  I expect my output to be three two one
  How can i do this?
  This is what I tried and it obviously didn't work...</p>
  
  <pre><code>#!/bin/bash
  i=0
  a="$"
  for word in $*; do
    echo $a$(($#-i))
    i=$((i+1))
  done  
  </code></pre>
  
  <p>This is the output i get</p>
  
  <pre><code>$3
  $2
  $1
  </code></pre>
  
  <p>I thought this would print the parameters in order 3, 2, 1 but it didn't. How should I do it? Any help will be much appreciated. Thank you.</p>