I have 3 files:
File1: &VAR1='1111';
File2: &VAR2 = '2222';
File3: &VAR1 = 1111
I want to change that for example with &NEWVAR = 'NEW';
So I have the following script:
A="\&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
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.
Can anyone help me with this?
Regards,