Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

According to the accepted answer for this SO question: , Python can make a great bash replacement.

My question then, is this: how do I go about seamlessly make the switch? I think the main thing to sort out to make such a switch would be: when starting a virtual terminal, call some Python shell (what though?), rather than something like Bourne shell.

Does that make sense? If yes, how could I go about doing that? This Wikipedia comparison of common shells doesn't list a single Python shell: Comparison of command shells

share|improve this question

2 Answers 2

up vote 5 down vote accepted

That thread and its accepted answer in particular are about using Python for shell scripting, not as an interactive shell.

To write scripts in a different language, put e.g. #!/usr/bin/env python instead of #!/bin/bash at the top of your script.

If you want to try out a different interactive shell, just run it, e.g. type ipython at your existing shell prompt. If you've decided to adopt that shell, set the SHELL environment variable at the start of your session (in ~/.profile in most environments, or in ~/.pam_environment), e.g. export SHELL=/usr/bin/ipython (.profile syntax) or SHELL="/usr/bin/ipython" (.pam_environment syntax).

None of the shells that I've seen based on advanced languages such as Perl or Python are good enough for interactive use in my opinion. They're too verbose for common tasks, especially the common job of a shell which is to launch an application. I wrote about a similar topic 4 years ago; I don't think the situation has fundamentally improved since then.

share|improve this answer

Ipython is ok. Also, look at the 'os' library.

share|improve this answer
    
You're right, IPython should have been an obvious choice...but how do I get IPython to start inside a terminal emulator, or inside an actual terminal, automatically? –  user89 Dec 27 '14 at 1:36
    
The command:chfn -s $( which ipython ) –  user400344 Dec 27 '14 at 1:37
    
That came out garbled... Just: chfn -s $( which ipython ) ... Make sure the full path to ipython is in /etc/shells . –  user400344 Dec 27 '14 at 1:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.