zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Somewhat unexpected results of {myfd}>&1 when noclobber set
Date: Sun, 10 Mar 2013 13:11:05 +0100	[thread overview]
Message-ID: <CAHYJk3QQTM9hUGiNonUhTEa=CrSutM+DErGXJO8VFobB7HV=_g@mail.gmail.com> (raw)
In-Reply-To: <130309071252.ZM19892@torch.brasslantern.com>

On 9 March 2013 16:12, Bart Schaefer <schaefer@brasslantern.com> wrote:

> The real question is whether math evaluation is applied when you do
>
>     print something >&$bar
>
> If $bar is not evaluated in that context, then it should not be in the
> dup context either, but if it IS evaluated in that context, then it
> should be treated consistently .  Guess what:
>
>     integer bar=1+1
>     print something >&$bar
>
> DOES print to stderr, so I would argue that the current behavior is
> the correct one (except for the spurious warning message).

Well, this 1+1 is evaluated when you assign to bar, not when you do >&$bar...
(not ignoring the rest of the message, just replying to this part for now).

% foo=1+1
% echo $foo
1+1
% print something >&$foo

results in the file 1+1 being created with contents 'something'.

-- 
Mikael Magnusson


  reply	other threads:[~2013-03-10 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 10:33 Mikael Magnusson
2013-03-09 15:12 ` Bart Schaefer
2013-03-10 12:11   ` Mikael Magnusson [this message]
2013-03-10 18:26     ` Bart Schaefer
2013-03-10 18:52   ` Peter Stephenson
2013-03-10 20:17     ` Peter Stephenson

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='CAHYJk3QQTM9hUGiNonUhTEa=CrSutM+DErGXJO8VFobB7HV=_g@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.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).