This is useful for transporting arbitrary settings to applications. It is difficult to implement because shell variable names apparently may not contain dots, but environment variables may. Solving this by parsing the variable name with shlex and re-joining the tokens would swallow white space and thus turn "FOO BAR=baz" into a valid assignment. So use everything up to the assignment operator verbatim as the variable name and only shlex the value.
Environment variables containing dots are handled fine by e.g. the env command and the subprocess module.
This is useful for transporting arbitrary settings to applications. It is difficult to implement because shell variable names apparently may not contain dots, but environment variables may. Solving this by parsing the variable name with
shlex
and re-joining the tokens would swallow white space and thus turn "FOO BAR=baz" into a valid assignment. So use everything up to the assignment operator verbatim as the variable name and only shlex the value.Environment variables containing dots are handled fine by e.g. the
env
command and thesubprocess
module.