9

Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?

wnoise
  • 9,764
  • 37
  • 47
teratorn
  • 1,489
  • 1
  • 11
  • 12

7 Answers7

24
  • Eshell is a Bash-like shell in Emacs Lisp.
  • IPython can be used as a system shell, though the syntax is a bit weird (supporting all of Python plus basic sh constructs).
  • fish has a core written in C, but much of its functionality is implemented in itself. Unlike many rare shells, it can be used as your login shell.
  • Hotwire deserves another mention. Its basic design appears to be "PowerShell in Python," but it also does some clever things with UI. The last release was in 2008.
  • Zoidberg is written in Perl and uses Perl syntax. A nice-looking project, shame it seems to have stalled.
  • Scsh would be a pain to use as a login shell (an example command from the docs: (run/strings (find "." -name *.c -print))), but it looks like a good "Perl in Scheme."
u0b34a0f6ae
  • 48,117
  • 14
  • 92
  • 101
skymt
  • 3,199
  • 21
  • 13
10

iPython (Python) and Rush (Ruby) are shells that are designed for more advanced languages. There's also Hotwire, which is sort of a weird integrated shell/terminal emulator.

sarnold
  • 102,305
  • 22
  • 181
  • 238
John Millikin
  • 197,344
  • 39
  • 212
  • 226
6

From all appearances, Python IS a shell. It runs with #! and it can run interactively. Between the os and shutil packages you have all of the features of standard Unix shells.

Since you can do anything in Python with simple, powerful scripts, you don't really need to spend any time messing with the other shells.

S.Lott
  • 384,516
  • 81
  • 508
  • 779
5

Well, there's emacs, which is arguably a shell written in lisp :)

Seriously though, are you looking for a reimplementation of an existing shell design in a different language such as Python? Or are you looking for a new implementation of a shell language that looks similar to your language of choice?

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
4

There is xon now:

http://xon.sh/

http://xon.sh/tutorial.html#running-commands

PyCon video - https://www.youtube.com/watch?v=uaje5I22kgE

mvallebr
  • 2,388
  • 21
  • 36
3

Tclsh is pretty nice (assuming you like Tcl, of course).

Mark Bessey
  • 19,598
  • 4
  • 47
  • 69
1

Try rash. It's a shell language written in Racket. It has a nice interactive-friendly syntax. You can embed Rash inside any normal Racket file as well as embedding normal Racket inside Rash. It's extensible and you can define new pipeline operators. It's still alpha quality at the moment, but it's pretty cool. Full disclosure: I wrote it.

William Hatch
  • 386
  • 3
  • 6