Skip to content

Releases: shellgei/rusty_bash

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

v0.5.0

13 Jul 05:13
Compare
Choose a tag to compare

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

12 Jul 08:06
Compare
Choose a tag to compare

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

11 Jul 00:07
Compare
Choose a tag to compare
  • 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

10 Jul 04:57
Compare
Choose a tag to compare

Implemented unset command.

🍣 A=aaaa
🍣 echo $A
aaaa
🍣 unset A
🍣 echo $A