Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Failure of "typeset" and exit status
- X-seq: zsh-workers 35085
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Failure of "typeset" and exit status
- Date: Mon, 11 May 2015 19:43:20 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author