Hello Andrew,
Unfortunately, this isn't portable, as I've just discovered at the cost
of quite a bit of time. In particular, you can't assume expr is present
and in the path on Windows. The Windows equivalent would be something like:
\setshell two\
@set /a c = 1 + :one && echo %c%
Hmmm... Can we assume that echo is really always there on Windows? If so,
the attached patch does something only with "echo".
I propose to prepare a patch along these lines. Alternatively we could
just drop it - I don't think the test matters all that hugely.
The point is to have some minimal coverage so that unexpected changes are
caught. This is the only call to a working \setshell.
--
Fabien.
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl
b/src/bin/pgbench/t/001_pgbench_with_server.pl
index 5a2fdb9acb..b82d3f65c4 100644
--- a/src/bin/pgbench/t/001_pgbench_with_server.pl
+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
@@ -512,7 +512,7 @@ pgbench(
qr{processed: 1/1},
qr{shell-echo-output}
],
- [qr{command=8.: int 2\b}],
+ [qr{command=8.: int 1\b}],
'pgbench backslash commands',
{
'001_pgbench_backslash_commands' => q{-- run set
@@ -524,10 +524,10 @@ pgbench(
\sleep 0 s
\sleep :zero
-- setshell and continuation
-\setshell two\
- expr \
- 1 + :one
-\set n debug(:two)
+\setshell another_one\
+ echo \
+ :one
+\set n debug(:another_one)
-- shell
\shell echo shell-echo-output
}