Re: Unsetting local variables

2017-03-17 Thread Martijn Dekker
Op 17-03-17 om 23:08 schreef Thorsten Glaser: > Martijn Dekker dixit: > >> Op 17-03-17 om 20:53 schreef Thorsten Glaser: >>> Even mksh’s “global” builtin does not access the global scope. >>> It’s simply a “typeset” that’s not also “local”. >> >> But why the separate builtin (which is unique to

Re: Unsetting local variables

2017-03-17 Thread Thorsten Glaser
Martijn Dekker dixit: >Op 17-03-17 om 20:53 schreef Thorsten Glaser: >> Even mksh’s “global” builtin does not access the global scope. >> It’s simply a “typeset” that’s not also “local”. > >But why the separate builtin (which is unique to mksh, if I'm not >mistaken) rather than 'typeset -g' as in

Re: Unsetting local variables

2017-03-17 Thread Martijn Dekker
Op 17-03-17 om 20:53 schreef Thorsten Glaser: > Even mksh’s “global” builtin does not access the global scope. > It’s simply a “typeset” that’s not also “local”. But why the separate builtin (which is unique to mksh, if I'm not mistaken) rather than 'typeset -g' as in zsh, bash 4 and yash?

Re: Unsetting local variables

2017-03-17 Thread Dan Douglas
On 03/17/2017 12:07 PM, Stephane Chazelas wrote: > Dan is describing what I can only explain as a bug or at least a > very surprising feature: The way Chet has described it in the past it sounded like an intentional compromise to make outer scopes accessible without the also possibly surprising

Re: Unsetting local variables

2017-03-16 Thread Dan Douglas
On 03/14/2017 05:08 AM, Jean Delvare wrote: > So internally bash does make a difference between a variable being > null and a variable being unset. A bash variable can actually have 4 > distinct states: non-existent, existent but unset, set but null, and > non-null. "typeset", "local" and "unset"