From: Peter Stephenson <p.stephenson@samsung.com>
To: undisclosed-recipients: ;
Cc: zsh-workers@zsh.org
Subject: Re: Failure of "typeset" and exit status
Date: Tue, 12 May 2015 09:42:25 +0100 [thread overview]
Message-ID: <20150512094225.37f668eb@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <150511194320.ZM12928@torch.brasslantern.com>
On Mon, 11 May 2015 19:43:20 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> 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
No, it isn't. The "g" is a bit of a snare and a delusion. "-g" means
"use the global scope, never create a new variable even if you're a
local scope". "+g" means "it's OK to create a new variable if you
need", it doesn't mean "never use the existing variable". Remember that
option letters with no argument have a binary effect in typeset and +g
is the default (exactly equivalent to saying -g is not the default).
You're using the -m option to refer to existing variables, so the +g has
no effect.
pws
next prev parent reply other threads:[~2015-05-12 8:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 2:43 Bart Schaefer
2015-05-12 8:42 ` Peter Stephenson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150512094225.37f668eb@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).