bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE? request for an "undefined" attribute for functions


From: Greg Wooledge
Subject: Re: RFE? request for an "undefined" attribute for functions
Date: Mon, 2 Aug 2010 15:17:39 -0400
User-agent: Mutt/1.4.2.3i

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

[Prev in Thread] Current Thread [Next in Thread]