2019-07-29 13:30:56 -0500, Eric Blake: > On 7/29/19 1:08 PM, Stephane Chazelas wrote: [...] > > I had the vague recollection that there was but I can't find it > > now. If there's not, that would be a bug in the spec as several > > shells including ksh, bash, zsh, yash treat it as the start of > > an array element assignment (like in: [...]
Sorry, I was wrong about yash. Array element assignment in yash is done with the "array" builtin. > > x[ foo > > + 1]=value > > Ouch. I think you've identified a real problem. Not that big a problem as I don't expect anyone would use "x[" in the first word of a command. Thanks for double-checking. I thought there was text that explicitely allowed that ksh behaviour, maybe I was confusing with [[...]] or ((...)). BTW, what's the point of 2.10.2 7a? It seems 7b already says what 7a says (if the TOKEN doesn't contain a =, then rule 1 applies). The distinction seems to be caused by the distinction between cmd_name vs cmd_word grammar rules which seems to be about keywords not being recognised after redirections or assignments, but I can't see how 7a/7b help there. -- Stephane