Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug Report: Env Vars and shell functions



On Jul 8,  1:49pm, Peter Bray wrote:
} Subject: Bug Report: Env Vars and shell functions
}
} 	Can others reproduce this bug in zsh-3.0-pre2, where a command
} line environment variable is ignored in other functions called by the
} original functions.

The local environment seems to get lost on the second and succeeding
passes around the 'for' loop.

zagzig[52] bar() { echo $1 $BAR }
zagzig[53] foo() { bar }
zagzig[54] BAR=foo foo
foo
zagzig[55] foo() { for x in 1 2 3 ; do bar $x ; done }
zagzig[56] foo
1
2
3
zagzig[57] BAR=foo foo
1 foo
2
3

I didn't try other looping constructs.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"




Messages sorted by: Reverse Date, Date, Thread, Author