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


Groups > gnu.bash.bug > #14072

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 20:29 +0200
Message-ID <mailman.13220.1525199363.27995.bug-bash@gnu.org> (permalink)
References <a16a34cf-eea7-16b8-76d8-e05d0fe2cc32@inlv.org> <1295e1ea-73c0-e479-da03-b784ec975030@inlv.org>

Show all headers | View raw


Op 01-05-18 om 18:45 schreef Martijn Dekker:
> It appears that it must have one function calling another, and that 
> other function having an assignment preceding a special builtin, for 
> 'unset' to fail silently for the variable so assigned.

Actually it can be simplified further: the following also outputs "BUG: 
still set". I fact, with this version, the bug manifests all the way 
down to bash 2.05b!

POSIXLY_CORRECT=y
func() {
   var=1
   var=2 :       # or 'var=2 set foo', or another special builtin
   unset -v var  # bug: fails silently
}
func
echo ${var+"BUG: still set"}

Thanks,

- 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 20:29 +0200

csiph-web