在一个文件中有以下内容:
public $password = 'XYZ';
我正在尝试通过备份文件的自动化部署过程,将密码值替换为另一个值。
我已经在一个文件中拥有可以匹配上述字符串的正则表达式,但与sed
不太兼容。
(public\s\$password\s=\s'(.*)'?)
我也尝试过
sed -i -e "s/public\s\$password\s=\s'(.*)'/private\s\$password\s=\s'jingle'" configuration.php
有什么想法吗?