Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parsing error on parsing 'A=1 time'
- X-seq: zsh-workers 44440
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>, Emil Gedda <emil.gedda@xxxxxx>
- Subject: Re: Parsing error on parsing 'A=1 time'
- Date: Thu, 20 Jun 2019 12:04:09 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190620110413euoutp013fb5e0f9a9a263cf293191f0fcb34398~p40oVfIsq0227202272euoutp01e
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1561028653; bh=DDNGyuFhaEg3fN1IYJm2CaY/ofWnxAS18B+eFuRxz1k=; h=Subject:From:To:Date:In-Reply-To:References:From; b=YM9IRlCc++AET+fnszAGnk4O3htJvsk0t8Tm/oh7zVCLuiac10TqvGuyhOwnPVuvs y720swMSxJas15tquMWjwA2c7BZdh0QUOsUKv2cSDCKyLmAER+ZSgacdhZtOKFItWE 1lhtvxW7NVcEzcPYV1kgFskgIBcS1m0UxdKwVuuo=
- In-reply-to: <7A677F3A-4047-4D2F-A7FD-A1362955A79E@ef.com>
- 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
- References: <CGME20190620101612epcas1p3cc8576152f0692b019570469379111e5@epcas1p3.samsung.com> <7A677F3A-4047-4D2F-A7FD-A1362955A79E@ef.com>
On Thu, 2019-06-20 at 10:14 +0000, Emil Gedda wrote:
> $ zsh -c 'A=1 time'
> zsh:1: parse error near `time'
It's a little obscure, but this isn't actually a bug. If you look in
the appropriate manual section, you'll see that "time" is defined as a
"complex command" which takes a pipeline as an argument. So assignments
etc. come after it (and potentially a number of "|"s with their own
command lines that may include assignemnets).
To put it another way, the parse error here is roughly similar to the
failure you get here:
A=1 { echo; }
In both cases, no command line can appear before the complex command.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author