I am writing a bash function that will run some commands to setup the environment and then leave the user at the prompt.
I can run
bash -c 'ls'
ls in bash.
I can also do
bash -c 'ls ; exec bash'
ls, and then leave a bash prompt open.
However, I want to source a file and setup some aliases, functions, and environment variables and then leave the prompt open, so something like this:
bash -c 'source env.sh ; exec bash'
Of course, this doesn't work because subshells will not inherit aliases or functions. Is there a way around this problem? I'd prefer to still have the user's
.bashrc be sourced, and not use the