It's something like a bug, between $var and /unset.
Test 1:
//var %i = 1 | var %hello01 = 1 | echo : $var(%hello*,%i)
$var works fine here
Let's use it in an /unset ...
Test 2:
//var %hello01 = 1 | echo 4 -a : %hello01 | unset -s $var(%hello*,1) | echo 4 -a : %hello01
Working fine too...
now let's use a variable name, instead of 1 at the $var
Test 3:
//var %hello01 = 1 | [color:red]var %i = 1[/color] | echo 4 -a : %hello01 | unset -s $var(%hello*,[color:red]%i[/color]) | echo 4 -a : %hello01
Looks like the variable is not unsetted anymore, even if in test 1, the $var returned fine... Pretty weird.
As a bugfix for it, you can use $($+(%,i),2) instead of %i.
Test 4:
//var %hello01 = 1 | [color:red]var %i = 1[/color] | echo 4 -a : %hello01 | unset -s $var(%hello*,[color:red]$($+(%,i),2)[/color]) | echo 4 -a : %hello01
Working fine now...
Edit:
If we make our own unset alias:
alias unset {
echo 4 -a unsetting $1-
}
And then we use the Test 3, which failed.
We will see:
-s was the switch we specified, and 1 is the value of %i
Even more weird
