From 2ac66a0e142a798f7f88de95829fb3939e1b93a2 Mon Sep 17 00:00:00 2001 From: jared Date: Thu, 16 Jul 2026 10:54:29 -0400 Subject: [PATCH] vault: session notes 2026-07-16 --- ...stdin-eval-and-wpengine-gateway-quoting.md | 56 +++++++++++++++++++ journal/2026-07-16.md | 7 +++ 2 files changed, 63 insertions(+) create mode 100644 howto/wp-cli-stdin-eval-and-wpengine-gateway-quoting.md diff --git a/howto/wp-cli-stdin-eval-and-wpengine-gateway-quoting.md b/howto/wp-cli-stdin-eval-and-wpengine-gateway-quoting.md new file mode 100644 index 0000000..3ae159b --- /dev/null +++ b/howto/wp-cli-stdin-eval-and-wpengine-gateway-quoting.md @@ -0,0 +1,56 @@ +--- +summary: "How to pipe PHP/SQL to wp-cli over the WP Engine SSH gateway — wp eval - does not read stdin (use wp eval-file - with a 'wp eval-file -' +``` + +## 2. WP Engine gateway strips one quoting layer from argv + +The gateway wraps the ssh command string in an extra `bash -c` evaluation. One layer of quotes/escapes is consumed before the command runs, so argv-embedded PHP/SQL — even `printf %q`-escaped — gets word-split or syntax-errors remotely. Diagnostic signature: + +``` +$ ssh pld 'echo "echo 1;" | wp eval -' +bash: -c: line 1: syntax error near unexpected token `|' +bash: -c: line 1: `echo echo 1; | wp eval -' # ← quotes already gone +``` + +**Rule: payloads ride stdin, never argv.** Stdin passes through untouched: + +```bash +printf '