bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Martijn Dekker
Subject: Re: [BUG] 'unset' fails silently under specific conditions
Date: Tue, 1 May 2018 23:27:26 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]