Releases: shellgei/rusty_bash
Releases Β· shellgei/rusty_bash
v0.5.8
Supported sequence expressions
{1..10}, {a..z}, {1..10..2}, and {a..z..2} type sequence expressions. Here are some examples.
π£ echo {1..10}
1 2 3 4 5 6 7 8 9 10
π£ echo {a..z}
a b c d e f g h i j k l m n o p q r s t u v w x y z
π£ echo {1..10..2}
1 3 5 7 9
π£ echo {a..z..2}
a c e g i k m o q s u w y
echo {3..-3..2}
3 1 -1 -3
### beyond bash ###
π£ echo {π..π¦}
π π π π π π π‘ π’ π£ π€ π₯ π¦
π£ echo {γ..γ}
γ γ γ γ
γ γ γ γ γ
### beyond zsh ###
π£ echo {γ..γ..2}
γ γ γ γ γ
You can also use them as brace expansions like
π£ echo {1..10..3}-th
1-th 4-th 7-th 10-th
π£ echo {1..2}{1..2}
11 12 21 22
v0.5.6
Supported $(( ))
and the four basic arithmetic operators in it
π£ echo Sush calculates $(( 1 - 2 * (3 + 4 ) )).
Sush calculates -13.
v0.5.5
Supported pipefail
### The exit status of true remains when the pipefail is off. ###
π£ set -o
pipefail off
π£ false | true
π£ echo $?
0
π£ set -o pipefail
### The exit status of the rightmost failed command remains when the pipefail is on. ###
π£ set -o
pipefail on
π£ false | true
π£ echo $?
1
v0.5.4
Supported -e option
The shell immediately stops if the last command of a pipeline puts a non-zero exit status.
$ sush
Rusty Bash (a.k.a. Sushi shell), version 0.5.4
π£ set -e
π£ false
$ # sush ends
If the command is left of && or ||, or in the condition of while, the shell doesn't stop.
$ sush
Rusty Bash (a.k.a. Sushi shell), version 0.5.4
π£ set -e
π£ false || echo OK
OK
π£ # sush doesn't stop.
π£ while false; do echo NG ; done
π£ # sush doesn't stop.
v0.5.3
Support -x and -v options.
π£ set -xv
π£ eval eval eval echo "a b c"
eval eval eval echo "a b c"
+ eval eval eval echo 'a b c'
++ eval eval echo a b c
+++ eval echo a b c
++++ echo a b c
a b c
v0.5.2
Enabled to use shopt -s extglob
and shopt -u extglob
π£ ls
builtins builtins.rs data.rs history.rs jobtable.rs shopts.rs
π£ shopt extglob
extglob on
π£ echo @(b)*.rs
builtins.rs
π£ shopt -u extglob
π£ shopt extglob
extglob off
π£ echo @(b)*.rs
Unexpected token: (
v0.5.0
Tuned to the following rule of Bash.
$ unset A
$ echo ${A:-"aaa
bbb"}
aaa
bbb
$ unset A
$ echo ${A:="aaa
bbb"}
aaa bbb
v0.4.11
Supported a strange rule of a braced parameter.
π£ echo ${BASH_VERSION}
0.4.11-rusty_bash
π£ echo ${BASH_VERSION-} #OK
0.4.11-rusty_bash
π£ echo ${BASH_VERSION-aaaaa} #OK
0.4.11-rusty_bash
π£ echo ${BASH_VERSION -aaaaa} #NG
sush: ${BASH_VERSION -aaaaa}: bad substitution
v0.4.9
- Implemented ${VAR:-word}, ${VAR:=word}, ${VAR:?word} and ${VAR:+word}.
### :- show a default string if A is not defined. ###
π£ echo ${A:-not defined}
not defined
### := show a default string and substitute it to A if A is not defined. ###
π£ echo ${A:=not defined}
not defined
π£ echo $A
not defined
### :? show a string as an error message if A is not defined. ###
π£ echo ${A:?not defined}
sush: A: not defined
### :+ show a string if A IS defined. ###
π£ A= ; echo ${A:+set}
π£ A=aaa ; echo ${A:+set}
set
- Fixed a bug at empty string substitution
π£ A=
π£ (commands were ignored on the previous versions)
v0.4.7
Implemented unset command.
π£ A=aaaa
π£ echo $A
aaaa
π£ unset A
π£ echo $A