Let's say I have two servers, A
and B
. I also have a bash
script that is executed on server A
that looks like this:
build_test.sh
#!/bin/bash
ssh user@B <<'ENDSSH'
echo "doing test"
bash -ex test.sh
echo "completed test"
ENDSSH
test.sh
#!/bin/bash
docker exec -i my_container /bin/bash -c "echo hi!"
The problem is that completed test
does not get printed to the terminal.
Here's the output of running build_test.sh
:
$ ./build_test
doing test
+ docker exec -i my_container /bin/bash -c "echo hi!"
hi!
I'm expecting completed test
to be output after hi!
, but it isn't. How do I fix this?