Re: bash-5.0: problem with variable scoping in posix-mode

2019-03-20 Thread Chet Ramey
> > Description: > > > > There is a problem with variable scoping when variable is created from > > assignment statement preceding function call in posix-mode. See an > > example below. > > > > > > Repeat-By: > > > > $ cat

Re: bash-5.0: problem with variable scoping in posix-mode

2019-01-30 Thread Chet Ramey
On 1/28/19 6:24 PM, Martijn Dekker wrote: > Op 27-01-19 om 22:59 schreef Chet Ramey: >> This is a consequence of a combination of two POSIX features. First, POSIX >> requires assignment statements preceding special builtins to create global >> variables (POSIX has no local variables) that persist i

Re: bash-5.0: problem with variable scoping in posix-mode

2019-01-28 Thread Martijn Dekker
Op 27-01-19 om 22:59 schreef Chet Ramey: > This is a consequence of a combination of two POSIX features. First, POSIX > requires assignment statements preceding special builtins to create global > variables (POSIX has no local variables) that persist in the shell context > after the special builtin

Re: bash-5.0: problem with variable scoping in posix-mode

2019-01-27 Thread Chet Ramey
On 1/27/19 7:58 AM, Alexander Tsoy wrote: > Bash Version: 5.0 > Patch Level: 2 > Release Status: release > > > Description: > > There is a problem with variable scoping when variable is created from > assignment statement preceding function call in posix-m

bash-5.0: problem with variable scoping in posix-mode

2019-01-27 Thread Alexander Tsoy
/L56xx/X56xx (IBRS update) GenuineIntel GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 5.0 Patch Level: 2 Release Status: release Description: There is a problem with variable scoping when variable is created from assignment statement preceding function call in posix-mode. See an example

Re: Variable scoping

2008-07-27 Thread Stephane Chazelas
On Fri, Jul 25, 2008 at 08:58:21AM +0300, Pierre Gaston wrote: [...] > With "sh" (a posix shell) no > In bash you can use the builtin "local" (or declare). [...] See http://stchaz.free.fr/locvar.sh for one way to implement local scope in a POSIX script. (those functions have not been thoroughly

Re: Variable scoping

2008-07-25 Thread Chet Ramey
Dan Stromberg wrote: Having a shell function's variable changes reflected in its caller really kinda makes me shudder - in fact, it reminds me of gosub. It seems like a bug waiting to happen; I'm amazed I haven't been bitten by it yet. This is as Posix has standardized: all variables are glo

Re: Variable scoping

2008-07-24 Thread Pierre Gaston
On Fri, Jul 25, 2008 at 2:07 AM, Dan Stromberg <[EMAIL PROTECTED]> wrote: > > Having a shell function's variable changes reflected in its caller really > kinda makes me shudder - in fact, it reminds me of gosub. It seems like > a bug waiting to happen; I'm amazed I haven't been bitten by it yet. >

Variable scoping

2008-07-24 Thread Dan Stromberg
Having a shell function's variable changes reflected in its caller really kinda makes me shudder - in fact, it reminds me of gosub. It seems like a bug waiting to happen; I'm amazed I haven't been bitten by it yet. It occurred to me that this might help - but of course it's probably quite a b