os/exec: passing single quotes to cmd.Env creates some weird escaping #26823
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
yes, with 1.10.3
What operating system and processor architecture are you using (
go env
)?What did you do?
Passing in cmd.Env environment variables with single quotes get mucked up
Repro:
test.sh:
test.go:
What did you expect to see?
I expected to see the literal environment variable as I specified it in the script:
DIND_REGISTRY='[ "docker.io", "192.168.254.1:5000" ]'
What did you see instead?
DIND_REGISTRY=''\''[ "docker.io", "192.168.254.1:5000" ]'\'''
The text was updated successfully, but these errors were encountered: