Rubish: A Unix shell written in pure Ruby

TL;DR

Rubish is a Unix shell written entirely in Ruby that supports Bash syntax and features. It allows running existing Bash scripts and seamlessly integrates Ruby code, offering a new way to combine shell scripting with Ruby’s capabilities. This development could impact scripting workflows and Ruby-based system automation.

Rubish, a Unix shell fully written in Ruby, has been released with full Bash compatibility and deep Ruby integration, allowing users to run existing Bash scripts and incorporate Ruby code directly into shell scripts.

Rubish is an open-source project that implements a Unix shell entirely in Ruby, parsing and compiling shell syntax into Ruby code which is then executed by the Ruby virtual machine. It supports all Bash features, making it compatible with existing Bash scripts, which can run without modification. The shell also offers advanced Ruby integration, enabling users to embed Ruby expressions, use Ruby methods, and chain commands with Ruby syntax.

The shell can be installed via Homebrew on macOS or built from source, and can be used interactively, for executing single commands, or as a login shell. Key features include Ruby conditionals, method call syntax for commands, command chaining, inline Ruby evaluation, Ruby array and regexp literals, lambda expressions, Ruby-style function definitions, customizable prompts, and lazy loading of environment initializations. It also supports Zsh-style features and can operate in restricted mode for safer execution of untrusted scripts.

Why It Matters

This development is significant because it bridges the gap between shell scripting and Ruby programming, enabling developers to leverage Ruby’s powerful features directly within shell scripts. It simplifies complex scripting tasks, enhances automation, and offers a unified environment for system management and scripting. The compatibility with Bash ensures minimal disruption for existing workflows, while the deep Ruby integration opens new possibilities for scripting and automation in Ruby-centric environments.

Amazon

Unix shell compatible with Bash

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Prior to Rubish, Unix shells like Bash and Zsh were dominant for scripting and command-line operations, but lacked deep integration with high-level programming languages. Ruby, known for its expressiveness and extensive libraries, has been popular for scripting but was not traditionally used as a shell language. If you’re interested in alternative Unix shells, check out Rubish, which aims to combine these worlds by creating a Ruby-based shell that preserves Bash syntax and features.

“Rubish is designed to be fully Bash-compatible while allowing deep Ruby integration, making it a powerful tool for developers who want the flexibility of Ruby in shell scripting.”

— Amatsuda (creator of Rubish)

“Running existing Bash scripts without modification can significantly streamline workflows, especially for Ruby developers looking to automate system tasks.”

— Open-source community member

Classic Shell Scripting

Classic Shell Scripting

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how widely adopted Rubish will become or how it performs in large-scale or complex scripting environments. Compatibility with all Bash scripts has been claimed, but real-world testing may reveal edge cases or limitations. Additionally, the long-term stability and support for this project are still uncertain, as it is relatively new.

Amazon

Bash and Ruby integration tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Next steps include community testing and feedback, development of additional features, and integration into more system environments. Developers may begin porting existing Bash scripts or creating new scripts that leverage Ruby’s capabilities. For more information on shell scripting and automation, visit the Rubish project page.

Beginning Portable Shell Scripting: From Novice to Professional (Expert's Voice in Open Source)

Beginning Portable Shell Scripting: From Novice to Professional (Expert's Voice in Open Source)

Used Book in Good Condition

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Can I run my existing Bash scripts in Rubish without modification?

Yes, Rubish claims full Bash compatibility, so existing Bash scripts should run without changes. However, any scripts with unsupported or edge-case features may require adjustments.

How does Rubish compare to traditional shells like Bash or Zsh?

Rubish supports Bash syntax and features but adds deep Ruby integration, allowing Ruby code within scripts and command chaining with Ruby methods. Unlike Bash or Zsh, it is implemented entirely in Ruby.

Is Rubish suitable for production system scripting?

While promising, Rubish is relatively new. Users should evaluate its stability and compatibility in their specific environments before deploying it for critical tasks.

How can I install Rubish?

On macOS, use Homebrew: ‘brew tap amatsuda/rubish’ followed by ‘brew install –HEAD rubish’. From source, clone the repository and follow the build instructions. It can also be used as a login shell or in scripts.

Source: Hacker News

You May Also Like

Rust 101: Why This Language Is Gaining Popularity

An introduction to Rust’s rising popularity reveals how its safety and speed are transforming software development—discover why developers are embracing this innovative language.

Choosing the Right Database: SQL Vs Nosql

Keep reading to discover how choosing the right database can impact your application’s scalability and data integrity.

C++26 Shipped a SIMD Library Nobody Asked For

C++26 ships with std::simd, a portable SIMD library criticized for being slow and outdated compared to compiler auto-vectorization and existing libraries.

Cross-Platform Development: Tools for 2026

In 2026, you’ll find cross-platform development tools like Flutter, React Native, and…