I want to reset the shell, when I exit / , reloading aliases, functions, from scratch.
But don't talk about source ~/.bashrc and . ~/.bashrc . ~/.bashrc !
Why? Because source or . they simply enrich the current shell with new functions, aliases, etc.
FYI, you can put this function in your bashrc:
function foo { echo "foo"; }
Then do source ~/.bashrc or . ~/.bashrc . ~/.bashrc . Yes, foo works. Then now edityour .bashrc and replace foo with bar to have:
function bar { echo "bar"; }
Now you can enter foo and see that the foo function still works , even though it no longer exists in the .bashrc . This is what I wanted to show.
I tried exec bash; but it does not load the .bashrc . And exec bash;source ~/.bashrc; obviously does not work, because exec kills the current process ( source never called).
source share