/unset prolly bug - 02/01/06 12:18 AM
It's something like a bug, between $var and /unset.
Test 1:
$var works fine here
Let's use it in an /unset ...
Test 2:
Working fine too...
now let's use a variable name, instead of 1 at the $var
Test 3:
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:
Working fine now...
Edit:
If we make our own unset alias:
And then we use the Test 3, which failed.
We will see:
unsetting -s 1
-s was the switch we specified, and 1 is the value of %i
Even more weird
Test 1:
Code:
//var %i = 1 | var %hello01 = 1 | echo : $var(%hello*,%i)
$var works fine here
Let's use it in an /unset ...
Test 2:
Code:
//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:
Code:
//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:
Code:
//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:
Code:
alias unset { echo 4 -a unsetting $1- }
And then we use the Test 3, which failed.
We will see:
Quote:
unsetting -s 1
-s was the switch we specified, and 1 is the value of %i
Even more weird