Releases: shellgei/rusty_bash
v1.2.2
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
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
- Add Fluent support and more by @LinuxBoy-96 in #146
- Cleaned, improved, and add comments by @LinuxBoy-96 in #147
- Add --help Support - improved by @LinuxBoy-96 in #151
- Compile-time language support + Name change + Panic abort by @LinuxBoy-96 in #152
- Fix bugs built on Android by @YumeYuka in #153
- Fix: "No resources found for language" error in ja_JP by @t-koba in #156
- Retry clippy (733 to 164) by @t-koba in #163
- Retry clippy (164 to 2) by @t-koba in #164
change log
Full Changelog: v1.2.0...v1.2.1
Thank you for all users and contributers!
v1.2.0
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
v1.1.8
Improvement of compatibility to Bash
We add various features and bug fixes to this version from v1.1.6. Added test cases are as follows:
- v1.1.6 -> v1.1.7: https://github.com/shellgei/rusty_bash_test/blob/v1.1.7/test_fixed.bash
- v1.1.7 -> v1.1.8: https://github.com/shellgei/rusty_bash_test/blob/v1.1.8/test_fixed.bash
What's Changed
- Added support for Android platform by @YumeYuka in #143
- Enabled to apply the integer mode to arrays and associative arrays
- Fixed some bugs around IFS
- Enabled to read a value to an element of an array
### an example ###
π£ read hoge[1] <<< abc
π£ echo ${hoge[1]}
- Enabled to use
unset
toward an array element - Considered
${a[ ]}
as${a[0]}
- Enabled to show the list of traps with
trap
command - Supported options
-a
option (auto export of variables)-C
option (protection of files at redirects)- execfail
- lastpipe
- Fixed single quoting rule on the value check of double quoted braced parameters
$ echo "${A-'"""'hey}"
''hey
$ echo "${A-'"\"'hey}"
'"'hey
$ echo "${A-'"aa"'hey}"
'aa'hey
- Fixed
eval
andlet
commands
New Contributors
Full Changelog: v1.1.6...v1.1.8
v1.1.6
Improvement of Job Control
Job control and some features are added to this shell. See additional test cases between v1.1.5 and v1.1.6 in our test.
The number of passed test scripts (run-***) in Bash repo increased from 15 to 20.
additions and corrections
- addition of
disown
,kill
, andhash
commands - implementation of behaviors of
wait
at-n
option
π£ sleep 10 &
16279
π£ wait -p a -n %%
π£ echo $a
16279
- enabled to set a pid to a variable with
wait
- tilde expansions after = and :
π£ echo A=~/:~/:~/
A=/home/ueda/:/home/ueda/:/home/ueda/
- enabled to use a jobspec lika a command
π£ sleep 10 &
16110
π£ %%
sleep 10
- fixed behavior of the shell at definition/use of aliases
### examples ###
π£ alias a='echo A'
π£ a a
A a
π£ alias a='echo A '
π£ a a
A echo A
π£ alias a='echo abc \'
π£ a|rev
abc |rev
π£ a |rev
cba
Full Changelog: v1.1.5...v1.1.6
v1.1.5
Compatibility improvement
We add some features to this shell and fix some incompatible behaviors based on the test in official Bash repo. See additional test cases between v1.1.4 and v1.1.5 in our test.
- Fixed the behavior of our shell when it is feeded a shell script containing lines that should be read by a command in the shell script.
### example ###
π£ echo 'cat
> This line is read by the above cat' | sush
This line is read by the above cat
- Invalidate ANSI-C quoting in here documents
- Implemented substitutions for every element in an array
### example ###
π£ set abc abc; echo ${*/a/A}
Abc Abc
- Enabled to parse $"..." (roughly)
- Enabled to use
declare -r
for an element of an array
Full Changelog: v1.1.4...v1.1.5
v1.1.4
Compatibility improvement
- Supported the followings
- Initialization of arrays or associative arrays with indexes (e.g.
A=([4]=hato [1]=yaha [2]=yoi [6]=furo)
) - Enabled to use
$!
(PID of the latest background job) - Support of the empty blacket
[]
on file glob - Immediate abort of a case command at an error of arithmetic expansion in a pattern
- Improvement of
IFS
compatibility when$*
is used - Support of the heredocument with
<<-
- Fix of
getopts
when it is used in a function
- Initialization of arrays or associative arrays with indexes (e.g.
other important change
The test scripts under test
were relocated to another repository because they contains test cases derived from the Bash repository licenced under GPL.
- The test cases added for this version can be seen in this file.
Full Changelog: v1.1.3...v1.1.4
v1.1.3
Fixed terrible bugs
I'm extremely sorry. That's terrible.
solved calculation problem
The implementation of arithmetic expressions in v1.1.2 has passed all of the tests in Bash repo. However, it mistook the following simple calculation. That is because the calculation was evaluated from the right side, ... and because our repo and Bash repo missed such an easy test case.
### It's wrong. (terrible) ###
π£ echo $(( 1 - 2 + 3 ))
0
We now fixed and the shell keeps a correct tally.
### calculated from the left side ###
π£ echo $((1 - 2 + 3))
2
### It must be evaluated from the right side in this case. ###
π£ a=3 b=3 c=3
π£ echo $(( a += b += c ))
9
π£ echo $a $b $c
9 6 3
solved an input mixing problem on source command
It's also terrible. The following is the behavior of v1.1.2.
### test.bash ###
echo OK | ( while read line ; do echo $line ; done )
γγγγγγοΌ
π£ source test.bash 2> /dev/null
γγγγγγοΌ # <- the read command reads the next line of test.bash
OK
It's fixed at v1.1.3.
source test.bash 2> /dev/null
OK
Full Changelog: v1.1.2...v1.1.3
v1.1.2-beta
Compatibility Improvements around arithmetic expression, and others
Based on the test in Bash repository, outputs are matched to those of Bash.
Examples
π£ n=0 a="(a[n]=++n)<7&&a[0]"; ((a[0])); echo "${a[@]}"
(a[n]=++n)<7&&a[0] 1 2 3 4 5 6 7
π£ unset a
π£ a=1 ; a[1]=2 ; echo ${a[@]}
1 2
π£ PARAM=abcdefg; echo ${PARAM:1 ? 4 : 2}
efg
π£ unset a
π£ A="a[0]" ;echo $(( ++$A))
1
π£ a=1 ; echo $((4+ + +a))
5
π£ a=1 ; echo $((4+ ++a))
6
π£ a=1 ; echo $((4+++a))
6
other improvement
- support of
globskipdots
- support of
REPLY
- support of
read -n
- support of
%u
,%o
,%i
onprintf
- support of
declare -i
Full Changelog: v1.1.0...v1.1.2
v1.1.0-beta
Additional implementation
- Addition on
printf
command- added "%x", "%X" as the formatter
- fixed behavior of "%q"
- enabled to repeatedly output when arguments are more than formatters
- support of format by number on "%d", "%s", "%X" (e.g. "%010d")
- Implementation of
let
command - Support of definition of functions without
()
whenfunction
keyword is used - Implementation of (nearly) accurate behavior of
read
andset
towardIFS
- Enable to refer positional parameters after
${10}
- Implementation of globstar
Full Changelog: v1.0.8...v1.1.0