I am setting a environment variable (bash) in makefile and I am executing a python script on the next line in the makefile. However, when I try to read the environment variable in the python script using os.environ.get()
I am unable to read the environment variable. What is the best way to achieve this?
You need to export it in the same line:
target:
export FOO=bar; python /the/script.py
or
target:
export FOO=bar; \
python /the/script.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With