terminus icon indicating copy to clipboard operation
terminus copied to clipboard

WP CLI problem with &amp in search replace

Open rushcreek opened this issue 5 years ago • 2 comments

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;

rushcreek avatar Feb 25 '20 15:02 rushcreek

Could this be related to https://github.com/pantheon-systems/terminus/issues/2039#issuecomment-557170708?

tannerhodges avatar Jun 04 '20 19:06 tannerhodges

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.

greg-1-anderson avatar Jun 04 '20 23:06 greg-1-anderson