Artificial intelligent assistant

Update phpmyadmin config.inc.php file in bash When you download and extract latest phpMyAdmin, it comes with a `config.sample.inc.php` file. I would like to set a random `blowfish_secret` value on this line: > $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ So, what I have tried so far is: #!/bin/bash cp config.sample.inc.php config.inc.php; search="\$cfg['blowfish_secret'] = '';"; replace="\$cfg['blowfish_secret'] = '1234';"; sed -i -e 's/$search/$replace/g' config.inc.php; # debug echo $search; echo $replace; cat config.inc.php; When I tested this script, the copied `config.inc.php` file does not appear to have been updated. Any ideas why? the `search` & `replace` fields are correctly getting set: ![enter image description here](

Try this instead :


sed -i "s/\$cfg\[.blowfish_secret.\]\s*=.*/$replace/" file


If you put _single-quotes_ around variables, the variables can't be expanded

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 94c3e1e1ac4459720423ccc51878637d