<p>im having the following code which works on yq 3 and when I try to upgrade to yq4 it fails</p>
<p>this works on yq3
<code>yq w -i dep.yaml 'spec.spec.image' $(MY_VAL)</code></p>
<p>on yq4 I got error that it doenst know <code>w</code>how can I make it works
I didn't find any match example which can help to my case</p>
<p><a href="https://mikefarah.gitbook.io/yq/upgrading-from-v3" rel="nofollow noreferrer">https://mikefarah.gitbook.io/yq/upgrading-from-v3</a></p>

PJEM
<p>Take a look at the section 'Updating / writing documents' of the <a href="https://mikefarah.gitbook.io/yq/upgrading-from-v3" rel="nofollow noreferrer">migration guide</a>.</p>
<p>The following command should work for your task with version 4 of <a href="https://mikefarah.gitbook.io/yq/" rel="nofollow noreferrer">yq</a>:</p>
<p><code>dep.yaml</code> before execution</p>
<pre class="lang-yaml prettyprint-override"><code>a:
  b: 1
spec:
  spec:
    image: image_old.jpg
c:
  d: 2
</code></pre>
<p><code>MY_VAL=&quot;image_new.jpg&quot; yq -i e '.spec.spec.image = strenv(MY_VAL)' dep.yaml</code></p>
<p><code>dep.yaml</code> after execution</p>
<pre class="lang-yaml prettyprint-override"><code>a:
  b: 1
spec:
  spec:
    image: image_new.jpg
c:
  d: 2
</code></pre>
