Re: totally replacing bash with IPython on my Linux system

Pete Forman <[email protected]> Thu, 10 Dec 2015 21:51:32 +0000
Newsgroups gmane.comp.python.ipython.user
Message-ID <[email protected]>
Brian Merchant <[email protected]> writes:

> I'd like to replace bash with IPython on my system, so that even files
> like .profile are in Python rather than shell script.
>
> I have some confusion on the topic, even though asking a few questions
> on the matter. Here are the questions I have asked previously:
>
> 1) *How can I replace bash with Python? *
> http://unix.stackexchange.com/questions/176091/how-can-i-replace-bash-with-python
>
> From the answer to that question, I learned how to automatically
> replace bash with IPython after log in.
>
> 2) *.profile is written in shell script -- can I get my system to
> understand that I want it to execute a Python script instead?*
> http://unix.stackexchange.com/questions/248477/profile-is-written-in-shell-script-can-i-instead-make-my-system-understand-th
>
> From the answer to that question, I learned that .profile file is
> "sourced" rather than "executed" -- that is, the lines in .profile are
> run one by one, as if one were typing them into the shell.
>
> So, my question now is: *how do I get my base system shell to be
> IPython, so that it can source ".profile" scripts that have IPython
> magics/Python written inside them? *For example, I'd like to write my
> .profile file using IPython magics/Python.
>
> Kind regards,
> Brian

To start ipython directly, bypassing bash, you need to alter your entry
in /etc/passwd. The last field of the entry will need to be changed from
/bin/bash to the full path of your ipython. It will probably need to be
added to /etc/shells too.

The ".profile" equivalents in IPython are in the startup folder of your
default profile.

http://ipython.readthedocs.org/en/stable/interactive/tutorial.html?highlight=startup

-- 
Pete Forman
https://payg-petef.rhcloud.com
(formerly on http://petef.22web.org/payg.html)