I'm using environment files to configure web apps. Recently i had the need to export a value like this:
RUBYOPT='-W:no-derecated -W:no-experimental'
This is contained in a file test.env with other config vars.
I use this command to export all the env vars in the file:
export $(cat test.env | xargs)
With the value like above, the command gives this error:
-bash: export: `-W:no-experimental'': not a valid identifier
I can export the value by copy pasting the output of cat test.env | xargs but in a single command like above it doesnt work.
Some testing revealed, that the issue appears when the value contains a space and somewhere after that a colon :.
What kind of quotation sorcery do I need to make my env-file work again?