Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14076

Re: [BUG] 'unset' fails silently under specific conditions

From Martijn Dekker <martijn@inlv.org>
Newsgroups gnu.bash.bug
Subject Re: [BUG] 'unset' fails silently under specific conditions
Date 2018-05-01 23:27 +0100
Message-ID <mailman.13231.1525213654.27995.bug-bash@gnu.org> (permalink)
References <a16a34cf-eea7-16b8-76d8-e05d0fe2cc32@inlv.org> <1295e1ea-73c0-e479-da03-b784ec975030@inlv.org> <59161dc5-bb33-d842-4af3-477e8784a4f5@inlv.org> <71d753dc-036f-7fd7-d703-408c3f8ac202@case.edu>

Show all headers | View raw


Op 01-05-18 om 19:36 schreef Chet Ramey:
> OK, so which is it? Does an assignment statement preceding a special
> builtin in a shell function create a local variable (as we discussed
> just yesterday)

Huh? That was about 'typeset'/'declare'. How is that relevant here?

>  or does it create a global variable because `Posix'?

Yes. POSIX does not specify local variables at all, and even in a bash 
context I see nothing there to indicate that it should be local.

The possibility that 'foo=bar :' might create a variable 'foo' that 
survives the ':' command, is exported, *and* is local to the function, 
hadn't occurred to me at all. POSIX is pretty strange sometimes but not 
*this* strange.

- M.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: [BUG] 'unset' fails silently under specific conditions Martijn Dekker <martijn@inlv.org> - 2018-05-01 23:27 +0100

csiph-web