[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars
From: |
Greg Wooledge |
Subject: |
Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars |
Date: |
Tue, 21 Jun 2016 08:06:13 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Jun 20, 2016 at 06:42:57PM -0700, L. A. Walsh wrote:
> The local, it seems is sets the local attrib to any future references
> of set/unset. Otherwise, it seems you'd have the situation of
> local Psx_Cor; unset Psx_Cor, where the "unset", counterintuitively,
> would unset the global, and the "local Psx_Cor" would just be
> ignored because it wasn't _set_ to a value.
This is very similar to the observations Freddy Vulto made, and from
which his "upvar" hack is derived:
http://www.fvue.nl/wiki/Bash:_Unset
http://www.fvue.nl/wiki/Bash:_Passing_variables_by_reference
I'm not saying this is a thing I would recommend using in Bash scripts,
but it's a thing that people may *be* using, since it has been known
and documented (via third-party sources) for years.