Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14066
| Path | csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Martijn Dekker <martijn@inlv.org> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode |
| Date | Mon, 30 Apr 2018 21:40:06 +0200 |
| Lines | 27 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.13179.1525117224.27995.bug-bash@gnu.org> (permalink) |
| References | <a16a34cf-eea7-16b8-76d8-e05d0fe2cc32@inlv.org> <2965f169-3d43-abf9-73a9-bc3142e2ef95@case.edu> <e8726a75-2137-24c8-781c-a920f308485d@inlv.org> <1463bbf8-96dd-4910-e9bb-d8688606a3c2@case.edu> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | usenet.stanford.edu 1525117225 14453 208.118.235.17 (30 Apr 2018 19:40:25 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| To | Chet Ramey <chet.ramey@case.edu>, Bug reports for the GNU Bourne Again SHell <bug-bash@gnu.org> |
| Envelope-to | bug-bash@gnu.org |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
| In-Reply-To | <1463bbf8-96dd-4910-e9bb-d8688606a3c2@case.edu> |
| Content-Language | en-GB |
| X-detected-operating-system | by eggs.gnu.org: GNU/Linux 3.x [fuzzy] |
| X-Received-From | 37.59.109.123 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <http://lists.gnu.org/archive/html/bug-bash/> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| Xref | csiph.com gnu.bash.bug:14066 |
Show key headers only | View raw
Op 30-04-18 om 21:12 schreef Chet Ramey:
>> 2. The bug is: 'declare +x' a.k.a. 'typeset +x' then fails to unexport the
>> variable in the second version above. The variable remains exported past
>> 'typeset +x foo', as proven by grepping the output of 'env'.
> Now you've just created a local variable (typeset in a function creates
> local variables, even in Posix mode) and made sure it doesn't have the
> export attribute. You haven't given it a value, so it remains unset and
> doesn't shadow the exported global you created in step 1.
Of course, that makes complete sense.
However, when adding the -g option, on bash 4.3.30, 4.4.19 and dev
snapshot 2018-04-20:
$ bash -o posix -c 'fn() { foo=abc : ; typeset -g +x foo; env|grep
^foo=; }; fn'
foo=abc
Causing 'typeset' to operate on the global scope had no effect. I had
noticed that it made no difference, so I incorrectly figured the -g flag
wasn't relevant and left it out of my bug report.
In any case, that still looks like a bug to me... particularly as bash
4.2.45 works as expected, so it seems to break as of 4.3.
- M.
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode Martijn Dekker <martijn@inlv.org> - 2018-04-30 21:40 +0200
csiph-web