Posted By

oznek on 10/08/10


Tagged


Versions (?)

Reverse parameters order


 / Published in: Bash
 

  1. !/bin/sh
  2.  
  3. reverse_order()
  4. {
  5. for n in $@
  6. do
  7. reverse="$n $reverse";
  8. done
  9.  
  10. echo $reverse
  11. }
  12.  
  13. # example
  14. reversed=$(reverse_order $@)

Report this snippet  

You need to login to post a comment.