Skip to content

Releases: shellgei/rusty_bash

v0.7.5

14 Sep 03:56
Compare
Choose a tag to compare

Supported the test compound command [[ ]] and file check options

-a, -b , -c, -d, -e, -f, -g, -h, -k, -p, -r, -s, -t, -u, -w, -G, -L, -N, -O, -S are available in [[ ]].
This is an example.

🍣 [[ -a /etc/passwd ]] ; echo $?
0
🍣 [[ -a /etc/passwdaaa ]] ; echo $?
1

The meanings of options can be seen in the CONDITIONAL EXPRESSIONS part of man bash.

v0.7.3

04 Sep 14:12
Compare
Choose a tag to compare

Supported -c option

Like this.

$ sush -c 'echo HELLO WORLD'
HELLO WORLD

v0.7.1

29 Aug 10:42
Compare
Choose a tag to compare

Enabled to read and execute shell scripts

We can use shell scripts with shebang from this version. The output with -v is also fixed as it becomes identical with that of Bash.

example

### example shell script ###
🍣 cat ~/tmp/hoge.sush 
#!/bin/sush -xv              # Change the path if necessary

echo abc

echo d\
ef

echo $LINENO

using the script with shebang

🍣 ~/tmp/hoge.sush 
#!/bin/sush -xv

echo abc
+ echo abc
abc

echo d\
ef
+ echo def
def

echo $LINENO
+ echo 8
8

using the script without shebang

🍣 sush ~/tmp/hoge.sush 
abc
def
8
🍣 sush ~/tmp/hoge.sush -xv
#!/bin/sush -xv

echo abc
+ echo abc
abc

echo d\
ef
+ echo def
def

echo $LINENO
+ echo 8
8

v0.7.0

23 Aug 11:19
Compare
Choose a tag to compare

Supported Zsh like n-digit output

Here are the examples:

🍣 echo $(( [#2] 1000 + 23 ))
2#1111111111
🍣 echo $(( [#8] 1000 + 23 ))
8#1777
🍣 A=2#11111110 ; echo $(( [#16] A ))
16#FE

v0.6.8

17 Aug 03:14
Compare
Choose a tag to compare

Supported "for command"

### example 1 ###
🍣 for n in A B C ; do echo $n ; done
A
B
C
### example 2 ###
🍣 set one two three
🍣 for n ; do echo $n ;done
one
two
three
### example 3 ###
🍣 for ((n=0;n<3;n++)) ; do echo $n ;done
0
1
2

v0.6.7

15 Aug 07:50
Compare
Choose a tag to compare

Supported floating operation

It may be helpful for some people.

🍣 echo $(( 1.0 / 2  ))
0.5
🍣 echo $(( 1 / 2  ))
0
🍣 A=1.1 ; echo $(( A*3  ))
3.3000000000000003
🍣 echo $(( 1.1**1.1 ))
1.1105342410545758

Enjoy.

v0.6.6

12 Aug 09:21
Compare
Choose a tag to compare

Support n-digit numbers (2 <= n <= 64)

Examples:

🍣 echo $(( 64#@ )) $(( 64#_ ))
62 63
🍣 echo $(( 2#11 + 2#01 ))
4
🍣 echo $(( 010  ))
8
🍣 echo $(( 0xA )) $(( 0Xa ))
10 10
🍣 echo $(( 64#WTF ))
241129

v0.6.5

12 Aug 08:00
Compare
Choose a tag to compare

Support of the compound command (( ))

🍣 (( 0 ))
🍣 echo $?
1
🍣 (( 1 ))
🍣 echo $?
0
🍣 (( 1 + 2 + 3 + 4 - 10 ))
🍣 echo $?
1
🍣 A=0 ; (( A )) || echo "A is FALSE"
A is FALSE
🍣 A=-1 ; (( A )) && echo "A is TRUE"
A is TRUE

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.