Size: 672
Comment: bash --rcfile /my/custom/bashrc
|
Size: 743
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
[[Anchor(faq23)]] | <<Anchor(faq23)>> |
Line 3: | Line 3: |
Just specify a different start-up file: | |
Line 10: | Line 11: |
Put {{{exec bash}}} at the end of it to launch an interactive shell. This shell will inherit the environment (which does ''not'' include aliases, but that's OK, because [#faq80 aliases suck]). Of course, you must also make sure that your script runs in a terminal -- otherwise, you must create one, for example, by using {{{exec xterm -e bash}}}. | Put {{{exec bash}}} at the end of it to launch an interactive shell. This shell will inherit the environment (which does ''not'' include aliases, but that's OK, because [[BashFAQ/080|aliases suck]]). Of course, you must also make sure that your script runs in a terminal -- otherwise, you must create one, for example, by using {{{exec xterm -e bash}}}. ---- CategoryShell |
I want to launch an interactive shell that has a special set of aliases and functions, not the ones in the user's ~/.bashrc.
Just specify a different start-up file:
bash --rcfile /my/custom/bashrc
Variant question: I have a script that sets up an environment, and I want to give the user control at the end of it.
Put exec bash at the end of it to launch an interactive shell. This shell will inherit the environment (which does not include aliases, but that's OK, because aliases suck). Of course, you must also make sure that your script runs in a terminal -- otherwise, you must create one, for example, by using exec xterm -e bash.