Skip to content

Releases: shellgei/rusty_bash

v0.6.4

07 Aug 01:26
Compare
Choose a tag to compare

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

04 Aug 05:40
Compare
Choose a tag to compare

Supported !, ~, <<, >>, <=, >=, <, >, ==, !=, &, ^, |, && and || in $(( ))

See the chapter ARITHMETIC EVALUATION in man bash for detail. I'm tired.

v0.6.2

03 Aug 14:14
Compare
Choose a tag to compare

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

30 Jul 08:53
Compare
Choose a tag to compare

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

28 Jul 02:49
Compare
Choose a tag to compare

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

27 Jul 00:31
Compare
Choose a tag to compare

Supported $(( )) and the four basic arithmetic operators in it

🍣 echo Sush calculates $(( 1 - 2 * (3 + 4 ) )).
Sush calculates -13.

v0.5.5

20 Jul 06:06
Compare
Choose a tag to compare

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

19 Jul 09:19
Compare
Choose a tag to compare

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

14 Jul 12:43
Compare
Choose a tag to compare

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

14 Jul 07:38
Compare
Choose a tag to compare

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: (