The variables in your /etc/bash.bashrc file are not exported. The file is read by any interactive non-login shell, but not by shell scripts (these are non-interactive).
Since the variables are not exported, they are not available in the environment of your script.
I would suggest not modifying the distribution-provided file /etc/bash.bashrc and instead:
- add the variables in the script itself (where they don't need to be exported) or:, or
- add them (and export them) in your personal
.bashrcfile, or:or - add them (and export them) in a separate
.shfile under/etc/profile.dwhich would export the variables for any login shell. A login shell is started either by your terminal application, or by your graphical environment when you log in (or both) or: - add the variables anywhere other than in the script itself (in a file not explicitly sourced by the script),.
Warning: If you add the variables anywhere other than in the script itself (in a file not explicitly sourced by the script), then the variables would not be available if you run the script from cron.