<p>I am currently trying to modify my image:tag in my build config from shell command using oc patch.<br />
My command is as such :</p>
<pre><code>oc patch bc/my-bc-name --patch '{&quot;spec&quot;:{&quot;strategy&quot;:{&quot;sourceStrategy&quot;:{&quot;from&quot;:{&quot;name&quot;: &quot;image:tag&quot; }}}}}'
</code></pre>
<p>what i want to do :</p>
<pre><code>oc patch bc/my-bc-name --patch '{&quot;spec&quot;:{&quot;strategy&quot;:{&quot;sourceStrategy&quot;:{&quot;from&quot;:{&quot;name&quot;: $myImage }}}}}'
</code></pre>
<p>such that the image name is specify as an environnement variable.
Unfortunately, i got :
Error from server (BadRequest): invalid character '$' looking for beginning of value</p>
<p>using simple/double quote nor ${myImage} does not seems to work as well.</p>
<p>any workaround to bypass this is more than welcomed :)</p>
<p>Kind regards</p>

Jason dricks
<p>Surround your environment variable with single quotes as shown below. This will allow the shell to replace/expand it with its value.</p>
<pre><code>oc patch bc/my-bc-name --patch '{&quot;spec&quot;:{&quot;strategy&quot;:{&quot;sourceStrategy&quot;:{&quot;from&quot;:{&quot;name&quot;: &quot;'$myImage'&quot;}}}}}'
</code></pre>
