I've defined variables in /etc/bashrc
in the following matter:
export VAR1=yadayada
I have bash script called runner.sh
with the following code below => we run there another script called run_test.sh
which is launching a python script. The python script uses the env variable mentioned above.
Here is runner.sh
content:
#!/bin/bash
exec /home/john/run_test.sh
When launching runner.sh
from shell I get an error that env variable is not defined.
If I launch the same runner.sh
from crontab, with having the env variable defined also in the crontab everything goes right.
Can you please explain why from shell run we are not "collecting" the env variable from bashrc
, and how it can be fixed?
No comments:
Post a Comment