bash automatically select specific variable from while
<p>Is there a way to call a variable through the $i in a while loop? To access a specific variable automatically?</p>

<p>This is a scaled down version of what i'm trying to do:</p>

<pre><code>i=1;

while [ $i -lt 4 ]; do
    let card$i=1;
    let i++;
done

let i=1;

while [[ $i -lt 4 ]]; do

    if [ "$card$i" = "1" ]; then 
        let card$i++;
    fi

    let i++;
done
</code></pre>

<p>Is there a way to make this work?</p>

<p>(I'm trying to do this with +50 variables. This is just scaled down)</p>

<p>Thanks.</p>