Looking at the code , we can see the method used to transmit commands. First, the command is created:
ssh ws.sk 'bash -se' << EOF-LARAVEL-ENVOY echo "Hello world from WS server!" echo $(pwd) pwd var_1="Hello" echo "${var_1}" EOF-LARAVEL-ENVOY
And then , this command is sent to run PHP proc_open
.
Since the input is transmitted via STDIN, it receives an interpretation by your local environment before sending. You can copy and paste the above into your terminal to see the same.
All that is needed is to avoid any characters that can be interpreted by the local environment; in this case, the characters are $
.
@task('ping-ws', ['on' => 'ws']) echo "Hello world from WS server!" echo \$(pwd) pwd var_1="Hello" echo "\${var_1}" @endtask
Please note that you may need to double the flight, not sure if Envoy will try the first screening for itself.
source share