zsh-users
 help / color / mirror / code / Atom feed
* question about posixbuiltins
@ 2015-04-12 13:40 Han Pingtian
  2015-04-13 21:44 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Han Pingtian @ 2015-04-12 13:40 UTC (permalink / raw)
  To: zsh-user

Hi,

The manual says:

POSIX_BUILTINS <K> <S>
       When  this option is set the command builtin can be used to exe‐
       cute shell builtin commands.   Parameter  assignments  specified
       before  shell  functions and special builtins are kept after the
       command completes unless the special builtin  is  prefixed  with
       the  command  builtin.   Special  builtins are ., :, break, con‐
       tinue, declare, eval, exit, export,  integer,  local,  readonly,
       return, set, shift, source, times, trap and unset.


But looks like the parameter assignment before "command special-builtin"
is kept even though POSIX_BUILTINS has been set:

% zsh -f
localhost% setopt posixbuiltins
localhost% foo=bar command export a=b
localhost% print $foo
bar
localhost%


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

* Re: question about posixbuiltins
  2015-04-12 13:40 question about posixbuiltins Han Pingtian
@ 2015-04-13 21:44 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2015-04-13 21:44 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

[This thread went into my spam folder for some reason.]

On Apr 12, 2015 4:03 PM, "Han Pingtian" <hanpt@linux.vnet.ibm.com> wrote:
>
> POSIX_BUILTINS <K> <S>
>        [...]  Parameter  assignments  specified
>        before  shell  functions and special builtins are kept after the
>        command completes unless the special builtin  is  prefixed  with
>        the  command  builtin.
> [...]
> But looks like the parameter assignment before "command special-builtin"
> is kept even though POSIX_BUILTINS has been set

Indeed I can confirm, it appears this either was never working or has been
broken by some recent change.

The default zsh behavior when posixbuiltins is not set, is to not keep the
assignment; that appears to work.

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

end of thread, other threads:[~2015-04-13 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-12 13:40 question about posixbuiltins Han Pingtian
2015-04-13 21:44 ` 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).