我想在''
数据库、用户名等之间添加相应的值。
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => '',
'username' => '',
'password' => '',
'host' => '',
'port' => '',
'driver' => '',
'prefix' => '',
),
),
);
我已经尝试跟随,但没有奏效。
sed -ie 's/'database' => ''/'database' => 'testdb'/g' file
就像这样(在sed
命令周围使用双引号:
sed -i "s/'database' => ''/'database' => 'testdb'/g" file
或者更好的正则表达式来处理 0 个或多个空格:
sed -i "s/'database' *=> *''/'database' => 'testdb'/g" file
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句