From: dana <dana@dana.is>
To: zsh-workers@zsh.org
Subject: [BUG] Redirect between two parameter assignments causes misbehaviour
Date: Sun, 10 Dec 2017 18:19:18 -0600 [thread overview]
Message-ID: <86CB677F-70BF-43B2-8F6D-E8F0AC4C43A3@dana.is> (raw)
One more before i forget. Someone found this on IRC today and it puzzled us.
The following command produces no output (and returns with 0):
% a=b 2> /dev/null c=d env
Doesn't matter what the command at the end is, could be a built-in too.
The documentation seems to suggest that it's valid for redirects to be
interspersed amongst the assignments *as well as* the command arguments, so i
think that should work? If not, the documentation needs clarified.
This is generally what happens to the variables afterwards:
% a=b 2> /dev/null c=d env; print -r -- ${a:--} ${c:--}
b -
Though it seems that certain interactions with other code can be quite serious.
If i run this without -f, something in my profile causes this series of commands
to hard-lock zsh with 100% CPU. Entering the first command and then the second
one separately avoids this lock-up. Unfortunately `set -x` didn't reveal
anything and i don't have any more time to look at it today, but i thought i'd
mention it.
dana
next reply other threads:[~2017-12-11 0:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171211001958epcas4p39fe7f2605374e3ea973e19b62beb9a9c@epcas4p3.samsung.com>
2017-12-11 0:19 ` dana [this message]
2017-12-11 1:07 ` Daniel Shahaf
2017-12-11 3:20 ` Daniel Shahaf
2017-12-11 12:01 ` Peter Stephenson
2017-12-11 21:26 ` dana
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=86CB677F-70BF-43B2-8F6D-E8F0AC4C43A3@dana.is \
--to=dana@dana.is \
--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).