I open a new terminal with bash as follows.

gnome-terminal -x bash
gnome-terminal -e bash
gnome-terminal -- bash

Somewhere I read that to use a custom BASH RC file, you have to run:

bash --login <custom_rc>

I'm not sure if it works, but the problem is that it doesn't leave the interpreter open like with the previous commands. I have also tried with:

bash -c "source <custom_rc>"

But the same thing happens, after reading the configuration closes.


According to the manual, the --rcfile switch accomplishes the objective in interactive mode.

--rcfile file

Execute commands from file instead of the standard personal initialization file ~/.bashrc if the shell is interactive

It seems we can infer that the environment variable, BASH_ENV, accomplishes the same in non-interactive mode.


If this parameter is set when bash is executing a shell script, its value is interpreted as a filename containing commands to initialize the shell, as in ~/.bashrc. [...]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.