bash - wildcards in file list
<p>So I have a bunch of measurements for a varying parameter <code>T</code> from different clients. The files are stored in <code>${LOGDIR}</code> and adhere to the following naming pattern:</p>

<pre><code>${LOGDIR}/client&lt;id&gt;/client_&lt;id&gt;_blahblah_T=&lt;param_value&gt;_rep=&lt;rep_no&gt;.log
</code></pre>

<p>I now want to select all clients' files for a fixed <code>T,rep</code></p>

<pre><code>for rep in {1..5}
do
    outfile=${OUTDIR}/"aux_rep${rep}.dat"
    for T in {1..64}
    do
        files="${LOGDIR}/log_client"*"/client"*"_T=C=${T}_rep=${rep}.log"
        echo "new iteration"
        printf '%s\n' "${files[@]}"
    done
done
</code></pre>

<p>this gets me exactly one output per iteration:</p>

<pre><code>new iteration
/home/.../log_client*/client*_T=&lt;param_value&gt;_rep=&lt;rep_no&gt;.log
</code></pre>

<p>Now obviously, I would have liked these <code>*</code> to have been resolved.</p>

<p>And I'm a bit surprised because I've used </p>

<pre><code>files="${LOGDIR}/${prefix}"*"${interm}"*"${ext}"
</code></pre>

<p>in other scripts successfully (although that was not within a loop and all files were in the same directory).</p>

<p>How do I get <code>files</code> to list the correct data files?</p>