Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parsing error on parsing 'A=1 time'



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