I'm trying to set each element from for loop to var in Bash.
This is my line:
counter=1 ;
for i in $(ls /);
do
echo line number $counter - $i ;
line"$counter"="$i" ;
echo $(line$counter);
counter=$[counter+1];
done
What I am trying to do, is set each i
variable to counted vars ($counter
).