[IPython-user] IPython shell : load my ~/.bashrc

Ville M. Vainio vivainio@gmail....
Sun Oct 12 16:02:46 CDT 2008

On Sun, Oct 12, 2008 at 11:06 PM, Yann Le Du <yledu@free.fr> wrote:

> I'm investigating Pysh, and I'd like to know how I may load all that I
> have defined in my ~/.bashrc ? Apparently, the underlying shell that
> ipython -p sh runs doesn't load my ~/.bashrc.
> I looked around, found something relating to interactive/non-interactive
> shells, played with .bash_profile but that led to nothing.

You need to port the contents of ~/.bashrc to something that ipython
can understand, and run that in ipy_user_conf.py. If you start pysh
from normal shell, you should inherit the environment from the bash
shell at least.

If it's really necessary, we may create a component that imports
select parts from bash scripts to ipython - parse export statements
and install aliases are obvious candidates.

If you just want to run the commands in .bashrc and ignore env vars
and aliases, you can just run "!bash ~/.bashrc".

Ville M. Vainio

More information about the IPython-user mailing list