Skip to content

Releases: shellgei/rusty_bash

v1.3.0

Choose a tag to compare

@ryuichiueda ryuichiueda released this 20 Jun 04:36

Correction of behavioral differences with Bash

We fixed some differences of output between bash and sush. Followings are major revisions.

  • Omitted evaluation of substring expansion for undefined variables
  • Behavior of read
    • implemented -t (timeout) option
    • Fixed some rules toward spaces or escaped spaces

See https://github.com/shellgei/rusty_bash_test/blob/v1.3.0/test_fixed.bash for details on the specific corrections.

Full Changelog: v1.2.9...v1.3.0

v1.2.9

Choose a tag to compare

@ryuichiueda ryuichiueda released this 30 May 10:27

Adding some features

We added some features related to the cases in https://github.com/shellgei/rusty_bash_test/blob/v1.2.9/test_fixed.bash .

Full Changelog: v1.2.7...v1.2.9

Completion of coproc implement

We fixed rough implementation around coproc. This version passes the official coproc test of Bash: https://github.com/ryuichiueda/bash_for_sush_test/blob/master/tests/coproc.tests .

Implementation of enable and enable -n

This is an example of usage.

🍣 type wait
wait is a shell builtin
🍣 enable -n wait
🍣 type wait
sush: type: wait: not found
🍣 enable wait
🍣 type wait
wait is a shell builtin

Implementation of ulimit -n

We can restrict the maximum number of file descriptors with this option.

🍣 ulimit -n 5
🍣 echo a | cat | cat | cat | cat | cat
target/debug/sush: cannot make pipe: Too many open files

Implementation of read -u <file descriptor>

With this option, we can change the file descriptor that read use.

🍣 read -ru3 x 3< <(echo bbb); echo $x
bbb

Others

  • Fixed some bugs on the parameter expansion
  • Enabled to use FD3 or larger number FDs when exec opens a file and connects to an FD.

v1.2.7

Choose a tag to compare

@ryuichiueda ryuichiueda released this 22 Feb 06:35

Fix and Addition

We fixed some bugs and added some features related to the cases in https://github.com/shellgei/rusty_bash_test/blob/v1.2.7/test_fixed.bash .

Bug fixes

Followings are fixed.

  • an unset rule when there are variables with the same name in different scopes
  • nameref rules
  • the difference between builtin/external test commands
### an example on Bash ###
bash-5.2$ [ -n = -n ]
bash-5.2$ echo $?
0
bash-5.2$ /usr/bin/[ -n = -n ]
/usr/bin/[: extra argument '-n'
bash-5.2$ echo $?
2

Additional features

  • Build rules for freebsd targets by @tmfink in #177
  • -f option
🍣 echo *
core core.rs elements elements.rs error error.rs feeder feeder.rs i18n.rs main.rs main_c_option.rs proc_ctrl.rs signal.rs utils utils.rs
🍣 set -f
🍣 echo *
*

New Contributors

Full Changelog: v1.2.6...v1.2.7

v1.2.6

Choose a tag to compare

@ryuichiueda ryuichiueda released this 24 Jan 04:56

Fixed a bug that makes sush slow on WSL2

We removed a bug that calls a path search procedure when an internal command is called in a pipeline. It was critical in WSL2 because a path search procedure for a non-existent command takes tens of seconds. It also made bash-completion slow in many cases.

We also fixed some bugs related to the three test cases in https://github.com/shellgei/rusty_bash_test/blob/v1.2.6/test_fixed.bash .

Full Changelog: v1.2.5...v1.2.6

v1.2.5

Choose a tag to compare

@ryuichiueda ryuichiueda released this 03 Jan 10:31

Fix for bash-completion

This version additionally passed the test cases in https://github.com/shellgei/rusty_bash_test/blob/v1.2.5/test_fixed.bash .

What's fixed

  • Enabled to use -- on declare
    • e.g. declare -f -- some_func
  • Regarded the number of element of a scalar variable as 1 if it is initialized.
🍣 a=
🍣 echo ${#a[*]}
1
  • Implemented the reaction of shopt -q
  • Fixed the behavior of unset when localvar_unset is not defined.

Full Changelog: v1.2.4...v1.2.5

v1.2.4

Choose a tag to compare

@ryuichiueda ryuichiueda released this 01 Jan 09:03

Addition of features

This version additionally passed the test cases in https://github.com/shellgei/rusty_bash_test/blob/v1.2.4/test_fixed.bash .

What's Changed

  • Supported coprocess (coproc command)
🍣 coproc HOGE { while read A ; do echo "HOGE" $A ; done ; }
[1] 365259
🍣 echo bbb >&${HOGE[1]}
🍣 read V <&${HOGE[0]}
🍣 echo $V
HOGE bbb
🍣 echo ccc >&${HOGE[1]}
🍣 read V <&${HOGE[0]}
🍣 echo $V
HOGE ccc
🍣 jobs
[1]+  Running                 coproc HOGE { while read A ; do echo "HOGE" $A ; done ; } &
🍣 kill %1
🍣 jobs
[1]+  Done                    coproc HOGE { while read A ; do echo "HOGE" $A ; done ; }
🍣 jobs
🍣
  • Supported nameref
🍣 A=123
🍣 declare -n B=A    # B becomes a reference of A
🍣 B=xyz
🍣 echo $A
xyz
  • Spported FUNCNUME and BASH_LINENO

  • Impremented caller roughly

  • Fixed clippy warnings by @LifelessPumpkin in #172

  • Fixed bugs around arrays

New Contributors

Full Changelog: v1.2.3...v1.2.4

v1.2.3

Choose a tag to compare

@ryuichiueda ryuichiueda released this 16 Nov 09:22

Compatibility Enhancements

This version additionally passed the test cases in test_fixed_v1.2.3.bash.

What's Changed

  • supported localvar_inherit and localvar_unset

  • conformed the behavior of here-documents with Bash when the end marker is not independent in a line.

🍣 A=$(cat << EOF
aaa
EOF)          # required a line break before )
echo $A
sush: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
aaa.           # The value "aaa" is substituted to A though the above error message is given.
  • supported the combination of >() and the subsequent pipe
🍣 echo 123 | tee >(rev) | rev --
321
123
  • modified SUSH and BASH version values / cargo fmt by @t-koba in #167

Bug

We found that some functions of the latest bash-completion for Ubuntu 25.04 don't work. Basic file completion works well.

Full Changelog: v1.2.2...v1.2.3

v1.2.2

Choose a tag to compare

@ryuichiueda ryuichiueda released this 07 Sep 05:51

Compatibility Enhancements

This version additionally passed the test cases in test_fixed_v1.2.2.bash. Moreover, this version passed all of the cases in ifs-posix.tests, which is a test script in Bash official repo. It's amazing.

detalis

  • Fixed IFS problems
🍣 a=$'ab\001cd\001ef'; IFS=$'\001'; b=$'uv\177wx\177yz'; for w in ab${b}y${a}z ; do echo $w ; done
abuvwxyzyab
cd
efz
🍣 IFS=$' \t\n'
🍣 x=" a" ; set $x ; echo @$1@
@a@
🍣 IFS=": "; x=" a" ; set $x ; echo @$1@
@a@
🍣 IFS=": "; x=" a" ;echo @$x@
@ a@
🍣 IFS=$' \t\n'
  • Fixed set - problems
🍣 set x - ; echo $2
-
🍣 str="-"; set x $str ; echo $2
-
🍣 set "" ""; f() { echo $# ; } ; f "$@"
2
🍣 set "" ; f() { echo $# ; } ; f "$@"
1
🍣 set "" ; f() { echo $# ; } ; f "${@}"
1
  • Fixed bugs around arrays
🍣 c=(outside) ; f() { readonly c=(3) ; }; f; declare -p c
declare -ar c=([0]="3")
🍣 c=(outside) ; f() { readonly 'c=(3)' ; }; f; declare -p c
declare -ar c=([0]="(3)")
🍣 r=(1) ; f() { export r='(5)' ; }; f; declare -p r
declare -ax r=([0]="(5)")
  • Support printf %#x
🍣 printf "%#x\n" 12
0xc
🍣 printf "%#x\n" "'1"
0x31
🍣 printf "%#x\n" "'あ"
0x3042
🍣 tmp=$'\x7f'; printf "%#1x\n" "'$tmp"
0x7f
  • Fixed bugs of continue
🍣 for i in a b c; do echo $i; continue; echo bad-$i ; done; echo end-1
a
b
c
end-1
  • Fixed value check rules of braced variables
🍣 f() { echo "-${*-x}-" ; } ; f ""
--
🍣 echo F=~
F=/Users/ueda
🍣 echo ${A:-\a}
a
🍣 echo "${A:-\a}"
\a
🍣 echo ${A:-~}
/Users/ueda
🍣 echo "${A:-~}"
🍣 : ${A:=~}; echo $A
/Users/ueda
🍣 : ${A:=~:aa}; echo $A
/Users/ueda
🍣 : ${A:=~/bin:~/bin2}; echo $A
/Users/ueda
🍣 : ${A:=B=~/bin:~/bin2}; echo $A
/Users/ueda
🍣 B=aaa;C=D=~/bin:$B; echo $C
D=~/bin:aaa
  • Fixed tilde expansion rules in here-documents
🍣 cat << EOF
> ~
> EOF
~
🍣 cat << EOF
> ~/bin
> EOF
~/bin

Full Changelog: v1.2.1...v1.2.2

v1.2.1

Choose a tag to compare

@ryuichiueda ryuichiueda released this 12 Aug 07:30

Fixes around arrays and associative arrays and implementation of some features

We (four contributors!) have enhanced and revised various features. You can see the test script for v1.2.1 on https://github.com/shellgei/rusty_bash_test/blob/v1.2.1/test_fixed.bash .

support of >() (halfway)

🍣 echo 123 | tee >(rev) >(fold -b1) -
123
1
2
3
321
### issue: not yet connected to the subsequent pipe ###
🍣 echo 123 | tee >(rev) >(fold -b1) - | rev
1
2
3
321
321
γ€€γ€€γ€€γ€€γ€€γ€€γ€€#stopping here
γ€€
^CPid: Pid(15326), Signal: SIGINT

fixes around arrays and associative arrays

  • support of element append on associative arrays
🍣 declare -A a=( [i]=abc ) ; a+=( [i]+=def ); declare -p a
declare -A a=([i]="abcdef" )
  • support of integer mode on associative arrays

multi-language support by @LinuxBoy-96

$ LANG=ja_JP.UTF8 sush 
Homebrew Bash completions do not work in POSIX mode
Sushi shell (a.k.a. Sush), バージョン 1.2.1 - release
🍣 exit
$ LANG=ar_AR.UTF8 sush 
Homebrew Bash completions do not work in POSIX mode
Sushi shell (a.k.a. Sush), Ψ₯Ψ΅Ψ―Ψ§Ψ± 1.2.1 - release
🍣 

others

  • fixes for Android by @YumeYuka
  • fixes based on clippy warnings by @t-koba
  • implementation of declare -u
  • implement of ulimit (halfway)
  • implement of @k, @K, @Q for parameters
🍣 a=abc ; echo ${a@k}
'abc'
🍣 A=(a b) ; echo "${A[@]@K}"
0 "a" 1 "b"
🍣 A=(a b) ; echo "${A[@]@Q}"
'a' 'b'

merged pull requests

change log

Full Changelog: v1.2.0...v1.2.1

Thank you for all users and contributers!

v1.2.0

Choose a tag to compare

@ryuichiueda ryuichiueda released this 20 Jul 04:47

Enhanced Compatibility around Variables and Parameters

We have fixed subtle different behaviors between Bash and Sush mainly based on the run-array script in https://github.com/ryuichiueda/bash_for_sush_test/tree/master/tests . We can see the added test cases for this version from v1.1.8 in https://github.com/shellgei/rusty_bash_test/blob/v1.2.0/test_fixed.bash .

  • supported declare -f
  • fixed the difference between Bash and Sush on the handlings of arrays and associative arrays
    • I can't explain these very subtle fixes. Please see the cases in the URL indicated above.
  • fixed out put of declare -p

Full Changelog: v1.1.8...v1.2.0