Skip to content

shellgei/rusty_bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

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 or pull requests in a way you think sensible. We do not have a rigid rule at this stage.

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 โœ”๏ธ tilde โœ”๏ธ
arithmetic โœ”๏ธ word splitting โœ”๏ธ path name โœ”๏ธ
command substitution โœ”๏ธ parameter/variable $A ${A} โœ”๏ธ ${name:offset}, ${name:offset:length} โœ”๏ธ

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 ๐Ÿ™…

variables

Born Shell Variables

features status features status features status
CDPATH ๐Ÿ™… HOME โœ”๏ธ IFS ๐Ÿ™…
MAIL ๐Ÿ™… MAILPATH ๐Ÿ™… OPTARG ๐Ÿ™…
OPTIND ๐Ÿ™… PATH โœ”๏ธ PS1 โœ”๏ธ
PS2 โœ”๏ธ

Bash Variables

features status features status features status
_ โœ”๏ธ BASH ๐Ÿ™… BASHOPTS ๐Ÿ™…
BASHPID โœ”๏ธ BASH_ALIASES ๐Ÿ™… BASH_ARGC ๐Ÿ™…
BASH_ARGV ๐Ÿ™… BASH_ARGV0 ๐Ÿ™… BASH_CMDS ๐Ÿ™…
BASH_COMMAND ๐Ÿ™… BASH_COMPAT ๐Ÿ™… BASH_ENV ๐Ÿ™…
BASH_EXECUTION_STRING ๐Ÿ™… BASH_LINENO ๐Ÿ™… BASH_LOADABLES_PATH ๐Ÿ™…
BASH_REMATCH ๐Ÿ™… BASH_SOURCE ๐Ÿ™… BASH_SUBSHELL โœ”๏ธ
BASH_VERSINFO โœ”๏ธ BASH_VERSION โœ”๏ธ BASH_XTRACEFD ๐Ÿ™…
CHILD_MAX ๐Ÿ™… COLUMNS ๐Ÿ™… COMP_CWORD ๐Ÿ™…
COMP_LINE ๐Ÿ™… COMP_POINT ๐Ÿ™… COMP_TYPE ๐Ÿ™…
COMP_KEY ๐Ÿ™… COMP_WORDBREAKS ๐Ÿ™… COMP_WORDS ๐Ÿ™…
COMPREPLY ๐Ÿ™… COPROC ๐Ÿ™… DIRSTACK ๐Ÿ™…
EMACS ๐Ÿ™… ENV ๐Ÿ™… EPOCHREALTIME ๐Ÿ™…
EPOCHSECONDS ๐Ÿ™… EUID ๐Ÿ™… EXECIGNORE ๐Ÿ™…
FCEDIT ๐Ÿ™… FIGNORE ๐Ÿ™… FUNCNAME ๐Ÿ™…
FUNCNEST ๐Ÿ™… GLOBIGNORE ๐Ÿ™… GROUPS ๐Ÿ™…
histchars ๐Ÿ™… HISTCMD ๐Ÿ™… HISTCONTROL ๐Ÿ™…
HISTFILE โœ”๏ธ HISTFILESIZE โœ”๏ธ HISTIGNORE ๐Ÿ™…
HISTSIZE ๐Ÿ™… HISTTIMEFORMAT ๐Ÿ™… HOSTFILE ๐Ÿ™…
HOSTNAME ๐Ÿ™… HOSTTYPE โœ”๏ธ IGNOREEOF ๐Ÿ™…
INPUTRC ๐Ÿ™… INSIDE_EMACS ๐Ÿ™… LANG โœ”๏ธ
LC_ALL ๐Ÿ™… LC_COLLATE ๐Ÿ™… LC_CTYPE ๐Ÿ™…
LC_MESSAGES ๐Ÿ™… LC_NUMERIC ๐Ÿ™… LC_TIME ๐Ÿ™…
LINENO โœ”๏ธ LINES ๐Ÿ™… MACHTYPE โœ”๏ธ
MAILCHECK ๐Ÿ™… MAPFILE ๐Ÿ™… OLDPWD โœ”๏ธ
OPTERR ๐Ÿ™… OSTYPE โœ”๏ธ PIPESTATUS โœ”๏ธ
POSIXLY_CORRECT ๐Ÿ™… PPID ๐Ÿ™… PROMPT_COMMAND ๐Ÿ™…
PROMPT_DIRTRIM ๐Ÿ™… PS0 ๐Ÿ™… PS3 ๐Ÿ™…
PS4 โœ”๏ธ PWD โœ”๏ธ RANDOM ๐Ÿ™…
READLINE_ARGUMENT ๐Ÿ™… READLINE_LINE ๐Ÿ™… READLINE_MARK ๐Ÿ™…
READLINE_POINT ๐Ÿ™… REPLY ๐Ÿ™… SECONDS ๐Ÿ™…
SHELL โœ”๏ธ SHELLOPTS ๐Ÿ™… SHLVL โœ”๏ธ
SRANDOM ๐Ÿ™… TIMEFORMAT ๐Ÿ™… TMOUT ๐Ÿ™…
TMPDIR ๐Ÿ™… UID ๐Ÿ™…

beyond Bash

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

Thanks to

Partially in Japanese.

Copyright

ยฉ 2022-2024 shellgei group