I have my wp-cli.yml
configured with a working ssh connection.
If I wp db query "CHECK TABLE $(wp db tables | paste -s -d, -);"
and run locally it works just fine.
On the other hand, if I wp @prod db query "CHECK TABLE $(wp db tables | paste -s -d, -);"
I get "too many positional arguments"
if I wp @prod option get home
- it works fine.
This leads me to conclude that the escaping of the remote command is causing the error - no amount of testing has revealed the "right" combination of single/double-quotes to get the command to the remote server.
Suggestions?
$()
works as expected with the desired output? What are you actually trying to do? This looks like a classic X Y problem where you asked how to fix your solution rather than how to solve your problemwp @prod db query "CHECK TABLE ${wp db tables | paste -s -d, -};"
orwp @prod db query "CHECK TABLE {$(wp db tables | paste -s -d, -)};"
do?