Skip to content

v1.2.2

Latest

Choose a tag to compare

@ryuichiueda ryuichiueda released this 07 Sep 05:51
· 6 commits to main since this release

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