sed is not changing the string : <p>I have 3 files:</p>

<pre><code>File1: &amp;VAR1='1111';
File2: &amp;VAR2 = '2222';
File3: &amp;VAR1 = 1111
</code></pre>

<p>I want to change that for example with &amp;NEWVAR = 'NEW';</p>

<p>So I have the following script:</p>

<pre><code>A="\&amp;VAR1\s*\=\s*'*[1]{4}'*"
for f in /u/123456/*; do
    if grep -qE $A $f; then
        sed 's/$LAREXP/$LACADE/g' $f
    fi
done
</code></pre>

<p>Grep tells me there are coincidence en File1 and File3, wich is correct, but the sed command is no replacing the old string with the new one in those files. It shows on screen the content of the files but there's no replace.</p>

<p>Can anyone help me with this?</p>

<p>Regards,</p>
