Releases: shellgei/rusty_bash
Releases Β· shellgei/rusty_bash
v0.6.4
Finshed implementation of operations in arithmetic expansion
Followings are the examples of additional part from v0.6.3:
π£ echo $(( A=10 , ++A ))
11
π£ echo $(( B=1 , A= B ? 1 : 2 ))
1
π£ echo $(( B=-1 , B+=1 , A= B ? 1 : 2 ))
2
v0.6.3
Supported !
, ~
, <<
, >>
, <=
, >=
, <
, >
, ==
, !=
, &
, ^
, |
, &&
and ||
in $(( ))
See the chapter ARITHMETIC EVALUATION in man bash
for detail. I'm tired.
v0.6.2
Supported ++
and --
in $(( ))
Like this
π£ A=1; echo $(( A ++ )) ; echo $A
1
2
π£ A=1; echo $(( ++ A )) ; echo $A
2
2
π£ A=1; echo $(( A -- )) ; echo $A
1
0
π£ A=1; echo $(( A -- + 3 )) ; echo $A
4
0
π£ A=1; echo $(( ++ $( echo A) )) ; echo $A
2
2
π£ A=1; echo $(( ++ "A" )) ; echo $A
2
2
π£ A=1; echo $(( ++ "$A" )) ; echo $A
1
1
v0.6.0
Implemented some features for $(( ))
Support of parameters and variables
π£ echo $(( $$ / $$ ))
1
π£ A=100 ; echo $(( A + $A ))
200
Support of **
π£ A=100 ; echo $(( 2 ** 10 ))
1024
π£ A=100 ; echo $(( 2 ** 0 ))
1
π£ A=100 ; echo $(( 2 ** -1 ))
sush: 2 ** -1 : exponent less than 0 (error token is "-1")
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: (