/rusty_bash

bash written with Rust

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Rusty Bash (a.k.a. sushi ๐Ÿฃ shell)

ubuntu-latest macos-latest

IMPORTANT: the main branch is switched to the shell develped for articles on SoftwareDesign. ๏ผˆไปŠใพใงใฎใƒกใ‚คใƒณใƒ–ใƒฉใƒณใƒใฏใ€้€ฃ่ผ‰ใฎใ‚‚ใฎใซๆฏ”ในใฆๆ•ฃใ‚‰ใ‹ใ‚Šใ™ใŽใชใฎใงใ€้€ฃ่ผ‰ใฎใ‚‚ใฎใ‚’mainใซๅˆ‡ใ‚Šๆ›ฟใˆใพใ—ใŸใ€‚๏ผ‰

What's this?

A clone of Bash, which is developed as a hobby of our group and for monthly articles on SoftwareDesign magazine published by Gijutsu-Hyohron Co., Ltd.

Quick Start

ueda@uedaP1g6:~$ git clone https://github.com/shellgei/rusty_bash.git
ueda@uedaP1g6:~$ cd rusty_bash
ueda@uedaP1g6:~$ cargo run
   Compiling sush v2025.6.9 (/home/ueda/GIT/rusty_bash)
    Finished dev [unoptimized + debuginfo] target(s) in 2.33s
     Running `target/debug/sush`
ueda@uedaP1g6:~๐Ÿฃ main๐ŸŒต

For Contributors

Since the main branch must synchronize the articles, further developments are reflected in the following branches. We prepared dev-* branches for adding your codes with pull requests.

  • dev-builtins: for builtin commands
  • dev-signal: for development on signal
  • dev-test: for development of a nice test system and test cases (we need more sophisticated test)
  • dev-others: for development of other features

These dev-* branches will be merged to the main branch depending on the situation of the articles. You can also propose some dev-foobar branches.

List of Features

  • โœ”๏ธ :available
  • ๐Ÿšง :partially available (or having known bugs)
  • ๐Ÿ™… : not implemented

simple commands

features status features status features status
command โœ”๏ธ substitutions โœ”๏ธ function definition โœ”๏ธ

compound commands

features status features status features status
if โœ”๏ธ while โœ”๏ธ () โœ”๏ธ
{} โœ”๏ธ case ๐Ÿ™… until ๐Ÿ™…
for ๐Ÿ™…

control operator

features status features status features status
|| โœ”๏ธ && โœ”๏ธ ; โœ”๏ธ
;; โœ”๏ธ | โœ”๏ธ & โœ”๏ธ
|& โœ”๏ธ

expansion

features status features status features status
brace {a,b} โœ”๏ธ brace {1..10} ๐Ÿ™… tilde โœ”๏ธ
parameter/variable $A ${A} โœ”๏ธ parameter/variable (others) ๐Ÿ™… command substitution โœ”๏ธ
arithmetic ๐Ÿ™… word splitting โœ”๏ธ path name โœ”๏ธ

builtin commands

features status features status features status
cd โœ”๏ธ pwd โœ”๏ธ read ๐Ÿ™…
exit โœ”๏ธ source ๐Ÿ™… set ๐Ÿ™…
shopt ๐Ÿ™… : โœ”๏ธ . ๐Ÿ™…
alias ๐Ÿ™… bg ๐Ÿ™… bind ๐Ÿ™…
break ๐Ÿ™… builtin ๐Ÿ™… caller ๐Ÿ™…
command ๐Ÿ™… compgen ๐Ÿ™… complete ๐Ÿ™…
compopt ๐Ÿ™… continue ๐Ÿ™… declare ๐Ÿ™…
dirs ๐Ÿ™… disown ๐Ÿ™… echo ๐Ÿ™…
enable ๐Ÿ™… eval ๐Ÿ™… exec ๐Ÿ™…
fc ๐Ÿ™… fg ๐Ÿ™… getopts ๐Ÿ™…
hash ๐Ÿ™… help ๐Ÿ™… history ๐Ÿ™…
jobs ๐Ÿ™… kill ๐Ÿ™… let ๐Ÿ™…
local ๐Ÿ™… logout ๐Ÿ™… mapfile ๐Ÿ™…
popd ๐Ÿ™… printf ๐Ÿ™… pushd ๐Ÿ™…
read ๐Ÿ™… readonly ๐Ÿ™… return ๐Ÿ™…
shift ๐Ÿ™… suspend ๐Ÿ™… test ๐Ÿ™…
times ๐Ÿ™… trap ๐Ÿ™… true โœ”๏ธ
type ๐Ÿ™… typeset ๐Ÿ™… ulimit ๐Ÿ™…
umask ๐Ÿ™… unalias ๐Ÿ™… unset ๐Ÿ™…
wait ๐Ÿ™… export ๐Ÿ™… false โœ”๏ธ

beyond Bash

features status
branch display in prompt โœ”๏ธ

Thanks to

Partially in Japanese.