Differences between revisions 1 and 2
Revision 1 as of 2007-05-02 23:09:58
Size: 35
Editor: redondos
Comment:
Revision 2 as of 2007-05-10 18:28:02
Size: 672
Editor: GreyCat
Comment: bash --rcfile /my/custom/bashrc
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
== Removed. == == I want to launch an interactive shell that has a special set of aliases and functions, not the ones in the user's ~/.bashrc. ==

{{{
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 [#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}}}.

Anchor(faq23)

I want to launch an interactive shell that has a special set of aliases and functions, not the ones in the user's ~/.bashrc.

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 [#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.

BashFAQ/023 (last edited 2016-08-31 00:32:52 by ormaaj)