Differences between revisions 10 and 11
Revision 10 as of 2008-11-14 14:48:20
Size: 678
Editor: GreyCat
Comment:
Revision 11 as of 2008-11-22 14:09:27
Size: 679
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[Anchor(faq23)]] <<Anchor(faq23)>>
Line 10: Line 10:
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}}}. 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}}}.

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 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)