1alias foobar 2{ 3 local a 4 @ a = [$0] - 1 5 echo *** Descending: Now $$a is $a 6 echo *** Global $$a is ${::a} 7 if (a >= 0) 8 { 9 foobar $a 10 } 11 echo *** Ascending: Now $$a is $a 12} 13 14alias go 15{ 16 assign a 31337 17 echo *** Ok. Lets see. $$a is $a (global) 18 foobar 10 19 echo *** Ok, all done. $$a is $a (global) 20} 21 22alias local2 23{ 24 local a. 25 @ a.b = 43 26 echo a.b is $a.b, a.c is $a.c 27 @ a.c = 23 28 echo a.b is $a.b, a.c is $a.c 29} 30alias go2 31{ 32 @ a.c = 37 33 echo a.b is $a.b, a.c is $a.c 34 local2 35 echo a.b is $a.b, a.c is $a.c 36} 37 38alias go3 39{ 40 local a 41 @ a = 10 42 if (1) 43 { 44 local b 45 @ b = 20 46 echo $$a should be 10, its [$a] 47 echo $$b should be 20, its [$b] 48 } 49 echo $$a should be 10, its [$a] 50 echo $$b should be 20, its [$b] 51} 52