I understand this type of question has been asked
Help me understand .profile, .bashrc, etc
Sequence of scripts sourced upon login
But I'm having a hard time understanding it.
I've got an Ubuntu machine setup so it connects to Jenkins as a slave. On this machine I've edited /etc/bash.bashrc and exported PATH with additional tools.
When I run a terminal (from the GUI) and execute
echo $PATH
I see the extra values on PATH.
When I run a sh script (from the GUI) which executes
echo $PATH
the extra values are missing.
If the same script is executed via "Startup Applications" the extra values are also missing from PATH.
Since I'm connecting to Jenkins using this approach that's a problem for me. i.e. It means my build jobs fail.
The only 'fix' I've found is to add the values to /etc/environment. When placed here the extra entries on the PATH appear in both scenarios.
But... only after the user logs back in/restarts. Which is not ideal.
How can I configure the machine so the extra entries are add to path for all scenarios?
FYI: I'm using Chef to configure the machine so it'll need to set these variables.
. /etc/environment
– terdon Oct 12 '16 at 16:04. /etc/environment
. The.
is thesource
command. See http://askubuntu.com/a/601131/85695. Sourcing a file will make any variables set in it available in your current shell session. – terdon Oct 12 '16 at 16:18