I have this code in bash
#!/usr/bin/env bash DB_NAME=$(CORE_CONFIG=core.config.core_test python -c "from core import config; print config.DATABASE['db_name']")
What I actually want is:
#!/usr/bin/env bash ENV_VARIABLE="CORE_CONFIG=core.config.core_test" DB_NAME=$($ENV_VARIABLE python -c "from core import config; print config.DATABASE['db_name']")
However bash complains that CORE_CONFIG is not a command.
I tried I think everything backticks, then nesting in various configurations. It has either no effect or 'command not found'.
How to do it properly?