Christian Fischer dixit:

>funct1() {
>� �local ifacelist
>� �funct2
>� �funct3
>}
>
>funct2() {
>� �# fill ifacelist 
>� �ifacelist="foo bar"
>}
>
>funct3() {
>� �# use ifacelist
>� �for var in $ifacelist; do
>� � � echo $var
>� �done
>}
>
>If you do so ifacelist is valid for all three functions but NOT for the 
>calling script or a calling function.

Interesting, this actually works (but I haven't yet seen it documented
that way – scoping in shell is truly unused by most).

Ok, so if you want to make it a local variable again, feel free to put
it back and point out I was wrong. (I wouldn't bother with scoping tho.)

bye,
//mirabile
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to