Skip to content

shellgei/rusty_bash

Repository files navigation

Rusty Bash (a.k.a. sushi 🍣 shell)

ubuntu-latest macos-latest

demo

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

$ git clone https://github.com/shellgei/rusty_bash.git
$ cd rusty_bash
$ cargo run
・・・
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/sush`
ueda@uedaP1g6:main🌵~/GIT/rusty_bash(debug)🍣

Install

$ git clone https://github.com/shellgei/rusty_bash.git
$ cd rusty_bash
$ cargo build --release
### ↓  Change /bin/ to /usr/local/bin/ or another path in $PATH if you are using Mac or BSD ###
$ sudo cp target/release/sush /bin/
$ cp .sushrc_for_linux ~/.sushrc # edit if some errors occur
$ sush
ueda@uedaP1g6:main🌵~/GIT/rusty_bash🍣

For Contributors

Please give us issues and pull requests in a way you think sensible. We do not have a rigid rule at this stage.

memo (20240704)

The dev-* branches are deprecated since the main branch is not synchronized to the articles any more.

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 ✔️

special parameters

features status features status features status
$ ✔️ ? ✔️ * ✔️
@ ✔️ # 🙅 - ✔️
! 🙅 _ ✔️

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 ✔️

options

features status features status features status
-c 🙅 -i ✔️ -l, --login 🙅
-r 🙅 -s 🙅 -D 🙅
[-+]O 🙅 -- 🙅 --debugger 🙅
--dimp-po-strings 🙅 --help 🙅 --init-file 🙅
--rcfile 🙅 --noediting 🙅 --noprofile 🙅
--norc 🙅 --posix 🙅 --restricted 🙅
-v, --verbose 🙅 --version ✔️ -e ✔️
--pipefail ✔️

shopt

features status features status features status
autocd 🙅 cdable_vars 🙅 cdspell 🙅
checkhash 🙅 checkjobs 🙅 checkwinsize 🙅
cmdhist 🙅 compat31 🙅 compat32 🙅
compat40 🙅 compat41 🙅 dirspell 🙅
dotglob 🙅 execfail 🙅 expand_aliases 🙅
extdebug 🙅 extglob 🚧 extquote 🙅
failglob 🙅 force_fignore 🙅 globstar 🙅
gnu_errfmt 🙅 histappend 🙅 histreedit 🙅
histverify 🙅 hostcomplete 🙅 huponexit 🙅
interactive_comments 🙅 lastpipe 🙅 lithist 🙅
login_shell 🙅 mailwarn 🙅 no_empty_cmd_completion 🙅
nocaseglob 🙅 nocasematch 🙅 nullglob 🙅
progcomp 🙅 promptvars 🙅 restricted_shell 🙅
shift_verbose 🙅 sourcepath 🙅 xpg_echo 🙅

beyond Bash

features status
branch display in prompt ✔️

Thanks to

Partially in Japanese.