terminus
terminus copied to clipboard
WP CLI problem with & in search replace
Expected behavior
Runs a search and replace (NOTE: I removed the semicolon from Issue Title for the purpose of corrent rendering.)
Actual behavior
[notice] Command: site.dev -- wp search-replace 'https://site.com/index?language=ENU&locale=USA#/signup' 'https://site.com/signup?language=ENU&locale=USA' wp_postmeta;` [Exit: 255] [error]
Steps to reproduce the behavior
terminus wp site.dev -- search-replace 'https://site.com/index?language=ENU&locale=USA#/signup' 'https://site.com/signup?language=ENU&locale=USA' wp_postmeta;
Could this be related to https://github.com/pantheon-systems/terminus/issues/2039#issuecomment-557170708?
This is caused by Pantheon SSH, which rejects any command where the command string contains certain characters (e.g. &
or ;
among others) anywhere on the commandline.
Workarounds are therefore often difficult. When possible, encode special characters without using &
, or put the command string on stdin rather than in an argument.