I currently encountered a tricky problem on which I couldn't find any solution yet.
I wrote a script like this:
#!/bin/sh
x=1
while [ "$x" -le $# ]; do
echo "$x"'. Argument is: ' "\$$x"
x="$(( $x + 1 ))"
done
I suggested that the shell would evaluate the expression "\$$x" after expanding the variables to get access to the argument on position x but the output is:
1. Argument is: $1
Please help. Thx in advance.