Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh silently abandons compound command on trying to write to a closed file descriptor
- X-seq: zsh-workers 39742
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: zsh silently abandons compound command on trying to write to a closed file descriptor
- Date: Thu, 27 Oct 2016 13:01:16 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=xW0Qai9cBTiGNh9rEcZh/GhkE2MxTY4jzW+IHRkITMg=; b=ohiAUdSn5PVYBscMYA0mghgfgIuoAlcP8ny9U+B6xhr1FGqL4+HD38CrReBbwNzRkN qeyWlNjCvBt7xbOYdDzqkspEJzQPperZ/KHd0L7VVGYIyYNzkUHiNnSw40Ztbt4g4MQ2 IuRK2HHNr38j9xN5h30/E41xPwAqeBNOOOQbOYI872Ms768VLFzwyuHw7XVLhvCWwCen UZ3Vl5LCEka4BhM9buNcj7S2f+94dA2ONcwhmvM2Hk8ZPQ9CDyCGc5yvoF7pZTYg7Lq3 2OXbK0DTnT14zxP91nUW8ReF3LVb8DwueBewLQKkjTl2nw1qBwZWejxUkfTQWtQtkkWe DamQ==
- In-reply-to: <6f70f97d-56cf-d09a-581c-4578a3124460@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <6f70f97d-56cf-d09a-581c-4578a3124460@inlv.org>
On Oct 27, 6:21pm, Martijn Dekker wrote:
}
} zsh misbehaves if a redirection produces an error due to writing to a
} closed file descriptor. For instance,
}
} echo hi >&- || echo oops
}
} doesn't output "oops" as expected.
This is exactly the same thing we discussed back in Feburary on the
thread you started with workers/38044, and which was also discussed
in January in workers/37505 and 37506, and which originally came
from workers/16556 with justification in workers/16559.
Somewhere in the middle of that it was noted that Bash no longer has
the behavior referenced in 16559, but there was never an assertion
that we ought to change zsh as well. The February thread just stops.
It's not "abandoning" the compound command, nor is it an issue with
the file descriptor; it's specific to the print builtin and its
synonyms, which includes echo.
torch% echo hi >&- && echo not abandoned
not abandoned
torch% /bin/echo hi >&-
/bin/echo: write error: Bad file descriptor
torch% echo $?
1
torch% /bin/echo hi >&- || echo oops
/bin/echo: write error: Bad file descriptor
oops
Messages sorted by:
Reverse Date,
Date,
Thread,
Author