Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Pipeline question (echo hello | echo $(cat))
- X-seq: zsh-users 13728
- From: Matthew Flaschen <matthew.flaschen@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Pipeline question (echo hello | echo $(cat))
- Date: Sun, 18 Jan 2009 19:36:19 -0500
- In-reply-to: <691a5d910901181603i3bc24236h9de853003d9d3e55@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <49738E4C.8070005@xxxxxxxxxx> <691a5d910901181603i3bc24236h9de853003d9d3e55@xxxxxxxxxxxxxx>
Bart Schaefer wrote:
> On Sun, Jan 18, 2009 at 12:17 PM, Matthew Flaschen
> <matthew.flaschen@xxxxxxxxxx> wrote:
>> echo hello | echo $(cat)
>>
>> cat: -: Input/output error
>
> Hmm.
>
> I'm not sure this is precisely an order-of-execution thing; rather, I
> think zsh over-optimizes
That is a good word...
> the way the builtin echo is run in the
> current shell scope.
It has nothing to do with echo being a built-in. You get the same
result with:
/bin/echo hello | /bin/echo $(/bin/cat)
or, the real reason this came up:
dpkg -S /usr/bin/nedit|dpkg -l $(cut -f1 -d':')
which does not work in zsh for the same reason.
> Consider that these variants do what you expect:
>
> echo hello | { echo $(cat) }
> echo hello | while echo $(cat); do break; done
True. That really doesn't do much to address my question, though, which
is whether zsh is complying with POSIX here.
Matt Flaschen
Messages sorted by:
Reverse Date,
Date,
Thread,
Author