So I need to reload my profile after making changes (this time due to a typo). I run source ~/.profile
and everything works perfectly fine.
However the source
command only applies to that terminal session. This means I'm running the command every time I open up a new terminal. I want to find a way to apply the .profile
/environmental variables to the entire user session without logging out, not just the current terminal.
Is there a package or command that can execute this type of change by reloading the profile like it loaded on login?
EDIT: To clarify that it is not a duplicate I don't want to use:
source ~/.profile
or
. ~/.profile
As they only effect changes on one terminal session. I want to effect changes across all started terminals from my user session. I already have changes in the current terminal session using those commands. I need them in newly opened terminal after I run the command (which to clarify I don't currently have. the changes are only effecting the current terminal and my question is to effect these changes across multiple terminals
You cannot. Environment variables are kept in each shell's per-process memory. Other processes (other shells, like the one you want to change eveything) cannot access this memory. Nor does
bash
listen to a socket for getting updates.Reread
man bash
, especially theINVOCATION
section.~/.profile
is more aksh
startup file. However, you could putsource $HOME/.profile
in your~/.bashrc
.