I am a bit stuck. My task is to print the arguments to my script in reverse order except the third and fourth.
What I have is this code:
#!/bin/bash i=$# for arg in "$@" do case $i in 3) ;; 4) ;; *) eval echo "$i. Parameter: \$$i";; esac i=`expr $i - 1` done
As I hate eval (greetings to PHP), I am looking for a solution without it but I am not able to find one.
How can I define the position of the argument dynamically?
PS: No its not a homework, I am learning shell for an exam so I try to solve old exams.