Whenever I modify my
.bashrc file, I have to go to each bash shell and source it again to effect the changes.
Is there a better way to do this? Some command that run once will automatically do a
source ~/.bashrc in all the open bash shells?
No I don't think this is possible. Nor should it be. This would basically amount to a way to inject code into an already launched and active shell and would pose a significant security threat.
Many daemon processes are designed to do this. The typical way would be to send them the HUP (hangup) signal which causes them to re-launch after re-reading their config files. You could trigger this with something like:
However when doing this on bash, bash just shuts off. It's not a daemon and the system doesn't have it behave like one.
The long and the short of it is that you probably won't keep making changes to your bashrc so frequently as time goes on and it won't be much of an issue. When you do make changes, you will just have to re-source the file if you need the changes in running shells.
There's nothing built into bash. You could tell it to maybe reload
This is a lot of trouble an extra file accesses for what it's worth. Also, it puts a constraint on your