bash: how to do inline substitution/ expansion?
<p>I run a script 
./script.sh  , e.g.</p>

<pre><code>./script config.txt 480
</code></pre>

<p>which invoices something like</p>

<pre><code>command --crf "${crf##*=}"
</code></pre>

<p>It reads from a config file. The config file contains several parameters, named in a pattern: <code>&lt;parameter1&gt;&lt;number&gt;=&lt;value&gt;</code>,
e.g.</p>

<pre><code>crf480=18.2
crf720=18.5
(…)
</code></pre>

<p>Right now, I include some lines at the script's beginning:</p>

<pre><code>&lt;An IFS that reads the config&gt;
crf=$(cat "$config"|grep crf|grep $2)
qcomp=$(cat "$config"|grep qcomp|grep $2)
aqmode=$(cat "$config"|grep aqmode|grep $2)
…
</code></pre>

<p>so with ./script config.txt 480
$crf has the desired value (that of crf480).</p>

<p>I'd like to avoid that long list at the beginning and do the substitution/ expansion inline, so that "$crf" is expanded to "$crf480", depending on $2.
I spent some time on <a href="http://mywiki.wooledge.org/BashFAQ/" rel="nofollow noreferrer">https://mywiki.wooledge.org/BashFAQ</a> and searched this site here, but as I am not a native speaker and a quite limited knowledge of bash, I didn't manage to find a solution.</p>

<p>Is it possible to do such inline substitution in bash and if yes, how to do it?</p>