Open untoreh opened 5 years ago
Sup sets the env var as a string value, it shouldn't need any additional escaping.
I think you need to escape the "$HELLO" variable in the remote shell.
$ export HELLO="1 2 3"
$ $HELLO
bash: 1: command not found
$ "$HELLO"
bash: 1 2 3: command not found
Please, feel free to reopen if this doesn't help.
I don't think I understood what you meant.
The point is that sup doesn't escape quotes in the SUP_ENV variable. And since sup (well the go ssh package since sup does not do any mods) executes the command as an argument (bash -c "export SUP...."
) it ends up like
bash -c "...; export SUP_ENV="HELLO=" 1 2 3" OTHER_VAR=X"; ... "
when it should be
bash -c "...; export SUP_ENV="HELLO=\" 1 2 3\" OTHER_VAR=X"; ... "
The user has no control over the SUP_ENV variable
I might have misunderstood then. Can you provide a reproducer Supfile?
well there was already the command snippet just add a local network
# Supfile
version: 0.4
networks:
local:
hosts:
- localhost
commands:
env:
desc: print env
run: echo SUP_ENV is "$SUP_ENV"
SUP_ENV is not escaped:
this one does not break but the quoting is lost
this one does not break and preserves quoting