I want to echo $ANMIAL0 and then $ANIMAL1 using a script below.
But I get line 7: ${ANIMAL$i}: bad substitution error message. What's wrong?
#!/bin/sh
ANIMAL0="tiger"
ANIMAL1="lion"
i=0
while test $i -lt 2; do
echo "Hey $i !"
echo ${ANIMAL$i}
i=`expr $i + 1`
done