zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-users@zsh.org
Subject: Re: print builtin preceded by parameter assignment
Date: Thu, 11 Apr 2019 12:45:35 +0200	[thread overview]
Message-ID: <20190411104535.GB29775@cventin.lip.ens-lyon.fr> (raw)
In-Reply-To: <1554907186.6252.12.camel@samsung.com>

On 2019-04-10 15:39:46 +0100, Peter Stephenson wrote:
> On Wed, 2019-04-10 at 16:11 +0200, Vincent Lefevre wrote:
> > 1. If the command name is not a special built-in utility or function,
> > the variable assignments shall be exported for the execution environment
> > of the command [...]
> > 
> > In this case, the variable assignments should affect the output.
> 
> I see how you're interpreting this --- the "execution environment of the
> command" is anything the command happens to do, not just what the
> environment itself would show, while "the current execution
> environment", which explicitly isn't affected by a bit you didn't quote
> and which I assumed included "print" as it is part of the current
> execution environment, to you is just what happens after the command
> finishes.

Yes, for instance, I would have assumed the following to be similar:

cventin% zsh -c 'TZ=UTC print -P "%D{%c}"'
2019-04-11T12:41:37 CEST
cventin% zsh -c 'p() { print -P "%D{%c}" } ; TZ=UTC p'
2019-04-11T10:41:41 UTC

I don't see any reason why the current execution environment would
have a different meaning in the first case.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

      parent reply	other threads:[~2019-04-11 10:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190410125753epcas1p4052249a86c562165e1fe2a485d70e70b@epcas1p4.samsung.com>
2019-04-10 12:55 ` Vincent Lefevre
2019-04-10 13:14   ` Peter Stephenson
2019-04-10 14:11     ` Vincent Lefevre
2019-04-10 14:39       ` Peter Stephenson
2019-04-10 17:25         ` Bart Schaefer
2019-04-11 10:40           ` Vincent Lefevre
2019-04-11 20:58             ` Bart Schaefer
2019-04-11 21:42               ` Bart Schaefer
2019-04-24 12:31                 ` Vincent Lefevre
2019-04-24 16:00                   ` Bart Schaefer
2019-04-25 19:47                     ` Bart Schaefer
2019-04-11 10:45         ` Vincent Lefevre [this message]

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=20190411104535.GB29775@cventin.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --cc=zsh-users@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).