zsh-workers
 help / color / mirror / code / Atom feed
* Failure of "typeset" and exit status
@ 2015-05-12  2:43 Bart Schaefer
  2015-05-12  8:42 ` Peter Stephenson
  2015-05-13  4:59 ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Bart Schaefer @ 2015-05-12  2:43 UTC (permalink / raw)
  To: zsh-workers

torch% ( () { typeset +g -m \* && echo No error } )
(anon): failed to change user ID: operation not permitted
(anon): failed to change group ID: operation not permitted
(anon): failed to change effective user ID: operation not permitted
(anon): failed to change effective group ID: operation not permitted
No error
torch% 

OK, that's not SO bad, except that "typeset +g -m \*" is intended to
have made all the variables local ... which it has NOT, as you can see
(be sure to do this in a subshell if you try it yourself):

torch% ( () { typeset +g -m \* && unset -m \* } && typeset -p )
(anon): failed to change user ID: operation not permitted
(anon): failed to change group ID: operation not permitted
(anon): failed to change effective user ID: operation not permitted
(anon): failed to change effective group ID: operation not permitted
(anon): read-only variable: HISTCMD
torch% 

If I add the -h flag to mask specials, it works as expected:

torch% ( () { typeset +g -h -m \* && unset -m \* } && typeset -p )
typeset 0=Src/zsh
...
typeset zsh_scheduled_events
torch% 

Why did failure on those five variables result in ignoring +g for all of
the other variables?  And if failure is going to be treated as idempotent,
shouldn't it exit nonzero?

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-13 17:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12  2:43 Failure of "typeset" and exit status Bart Schaefer
2015-05-12  8:42 ` Peter Stephenson
2015-05-12  9:12   ` Peter Stephenson
2015-05-13  4:59 ` Bart Schaefer
2015-05-13  8:39   ` Peter Stephenson
2015-05-13 15:48     ` Bart Schaefer
2015-05-13 16:38       ` Peter Stephenson
2015-05-13 17:50         ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).