Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[BUG] Redirect between two parameter assignments causes misbehaviour
- X-seq: zsh-workers 42105
- From: dana <dana@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [BUG] Redirect between two parameter assignments causes misbehaviour
- Date: Sun, 10 Dec 2017 18:19:18 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=zdgdAlRBiAZJzC5V+s3hotnzIXQJstOscdFddzpmH80=; b=eC3P0JYznrWxZiF63WY4igU/UlXcfabpapiVv/ICKY9+1wpXKo9x/HClvAIX8s89+N 99uK7VIkT1jD7ePYrDYCPLXmFce6dCT3G3VwfhO8wiINTuCliFKEgU9H/8PxEcRANirw 8GCymVH6xHakTu6ts5eFsU0i53np9oNyWVCL8sbcG32KRBgf/UKoTjFVE7/77ub4iQEf 6eqvIbkNbjZBJUJFb9ObgOKWM1HjGKvVveoY0x4npnw/GazfWjdyvlDtU/fCYNwc9IGT Y9SiymtawNDgp6L7Q6i9kxXgp1KL16sgNvmx3vc4hnPHZp5YbrqJY2qoo47IouV33+Db RBUQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author