On 8 November 2010 17:28, David Korn <[email protected]> wrote:
> Subject: Re: Re: [ast-users] Is it correct that exporting function-local 
> variable  causes the variable not to be exported if the function exporting 
> the  local  variable calls another function and this function calls an 
> external  command ?
> --------
>
>> I see it now this way:
>> 1. typeset creates a variable local to a function
>> 2. The -x flag makes this variable as 'exported' if an external
>> command is called
>> 3. Another function must not see a variable local to another function,
>> even if the export flag is set for this variable
>>
>> Conclusion: The ksh93 behaviour is correct, bash4.0's behaviour is not.
>
> The conclusion is wrong.  Bash uses dynamic scoping so that a functiion
> sees all the local variales from the callers.  Therefore bash4.0 behavior
> is different, not incorrect.
>
> ksh88 used dynamic scoping as well, but I thought that that was a
> poor choice and I changed it.

I agree with you. The ksh93 behavior is much better and cleaner.

Ced
-- 
Cedric Blancher <[email protected]>
Institute Pasteur
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to