Assigning a multiline string to FOO works as expected:
$ read -d '' FOO <<"EOF"
> the content
> EOF
$ echo $FOO
the content
$ python -c "import os; print os.environ.get('FOO')"
the content
Seemingly the same thing with FOO_BAR_BAZ works differently:
$ read -d '' FOO_BAR_BAZ <<"EOF"
> the content
> EOF
$ echo $FOO_BAR_BAZ
the content
$ python -c "import os; print os.environ.get('FOO_BAR_BAZ')"
None
I either have a subtle error or a misunderstanding.
Did you
export FOObut notexport FOO_BAR_BAZ? Environment variables will only be visible to child processes (like Python) if they’ve been exported.