I have this command:
salt=123
sed -i '' "s,\/\* Replace with salts \*\/,$salt,g" ./wp-config.php
Which works well if I run it on a file that contains the line:
/* Replace with salts */
But if I assign salt
to the following multiline, with single quotes:
define('AUTH_KEY', 'oT0.1IG0ajXBDk.uCy?T@d?L.LgK|D3fz={VCq/IdP0fy.ZrI~WuM-9+5:-/DyPj');
define('SECURE_AUTH_KEY', '0PO8Zgs:g(CFkwFuIKy/[2[Kb|~BO@#+[WrmHZ dE8&u{LcPA.7P$OrH:% 7Bf=G');
define('LOGGED_IN_KEY', 'xPG6BW$d~~[!lL,e<r z~nlo}(~k^b?G`0.m!54rrRggaDbk%a7c(IRzBTx&MUUy');
define('NONCE_KEY', 'J#+Rn;lgjVzjW&X^hj/wi53Y/!B_[UClk1[H:?h6Je|$?dHSb`<n-f**RtNJl;,d');
define('AUTH_SALT', '>ho*kxR)1M4t)zni|tpDY.wn!>|Z-sVoULi(bY|0NQu/|G-2gAq=A;$3I%|`}kNb');
define('SECURE_AUTH_SALT', '--d5e0/8%^@Yg+3r UFAB`e-hR,;iMr.X]SOn-b~nU+aH[i5_gy]%hE<8V5LqQv1');
define('LOGGED_IN_SALT', 'k;J.$+/3)k0fU]nJ7Dtbh)a!Nr[/2m<uZNO+(:AGu!(B+cVeiXM,]ePdwRn-$~O-');
define('NONCE_SALT', ':)M$l+-U,QqCFm>8yPa5rIu9nQ<%i4?[.&PY|X&ta-MTpBp#&z+0i?|#~`%P~7,c');
I get the following error:
sed: 1: "s,\/\* Replace with sal ...": bad flag in substitute command: '''
Is there a way I can totally escape the contents of the salt
variable, and just do a flat out replace?
Others recommend using double quotes, but I think I'm already doing that?