Problem to get arguments with ${var}
Hello,
I would like to use a FOR statement to display all arguments received by my script.
I'm using the following code:
-------------------------------------
#!/bin/bash
declare nArguments=$#
for (( i=1; i<$nArguments; i++ ));
do
echo "var = ${i}"
done
-------------------------------------
echo "var = ${i}" --> this is not working, I also tried echo "var = ${\$i}" but this is the same result.
Thanks in advance for you help.
Alain.
|