On Mon, Aug 02, 2010 at 09:11:23PM +0200, Bernd Eggink wrote:
> Ksh and zsh also have the 'function' 
> keyword, probably other shells as well. I prefer it in ksh because it 
> makes locally declared variables really local, while with the name() 
> syntax they are shared with the environment.

What?!

imadev:~$ ksh -c 'unset var; var=main; foo() { typeset var; var=local; }; foo; 
echo $var'
main

That's ksh88.

arc3:~$ ksh -c 'unset var; var=main; foo() { typeset var; var=local; }; foo; 
echo $var'
local

That's ksh93.

Oh, how fun.  Whee!  Good thing I'm using bash, not ksh.

Reply via email to