LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rubish

UNIX shell written in pure Ruby

TLDR

Start an interactive Rubish session
$ rubish
copy
Run a single command and exit
$ rubish -c '[echo hello]'
copy
Execute a shell script file
$ rubish [script.sh]
copy
Start in restricted mode, disabling Ruby integration for untrusted scripts
$ rubish -r
copy
Pipe command output through Ruby methods
$ rubish -c '[ls().sort.uniq]'
copy

SYNOPSIS

rubish [-c command] [-r] [script] [arguments...]

DESCRIPTION

rubish is an interactive UNIX shell implemented entirely in Ruby. It parses familiar bash syntax and compiles it to Ruby for execution, so existing scripts keep working while the full Ruby language becomes available on the command line. It can be used as a login shell via chsh.The shell blurs the line between shell and scripting language. External commands return objects that can be chained with dot notation (for example ls().sort.uniq), output can be processed line by line with Ruby iterators such as .each and .map, and Ruby expressions may be used as conditions in if, while, and until by wrapping them in { }. A line beginning with a capital letter is evaluated directly as Ruby code, and functions can be defined with Ruby's def...end syntax.For familiarity it also supports a number of zsh conveniences, including setopt, autoload, and abbreviated path expansion, along with custom dynamically-generated prompts and lazy loading of slow initializations in background threads.

PARAMETERS

-c command

Execute command as a single string and exit.
-r
Restricted mode: disable Ruby integration features for running untrusted scripts.

CONFIGURATION

Rubish is configured in Ruby rather than a bespoke config language. Prompts are defined as Ruby functions for fully dynamic prompt strings, options can be toggled with zsh-style setopt, and expensive startup work can be deferred with lazy loading so the shell stays responsive.

CAVEATS

Rubish requires a compatible Ruby interpreter to be available. As a young project it is best treated as experimental for daily use, and the deep Ruby integration is a security concern when running untrusted input, which is why -r restricted mode exists.

HISTORY

rubish was created by Atsushi Matsuda (amatsuda), a prominent Ruby on Rails core contributor, as a shell written in pure Ruby. It is released as open-source software under the MIT license.

SEE ALSO

bash(1), zsh(1), fish(1), ruby(1), irb(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid