I have a script that outputs a list of env vars like:
THING=one
ANOTHER_THING=two
A_PATH="path/to a/directory"
When I try to export these env vars as export `./script`
, the A_PATH
env var exports as path/to
.
If I export the list as plain text like:
export THING=one ANOTHER_THING=two A_PATH="path/to a/directory"
, it works just fine.
I'm stumped as to why bash treats the white space in the A_PATH
differently in these two cases. I've tried various attempts at escaping the whitespace and I've even tried exporting line by line, but in every case it sees the whitespace as a delimiter rather than as a part of the path string.