I ran into a single quote problem using SED (Bash shell).
I need to do
$cfg['Servers'][$i]['password'] = '';
in
$cfg['Servers'][$i]['password'] = 'mypassword';
I tried:
sed -i "s/$cfg['Servers'][$i]['password'] = '';/$cfg['Servers'][$i]['password'] = '$rootpassword';/g" /usr/share/phpmyadmin/libraries/config.default.bak
Which ends by really fingering the line.
$cfg['Servers'][$i]['password['Servers'][]['passsword'] = 'mypassword'
I tried "\" to avoid single quotes, and I think that everything else is under the sun, but just can't get it at all.
Can anyone point out my likely obvious mistake?
Thanks.
source share