PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] A B=C not as expected
Date: Thursday, 24 Sep 2020, 07:46:21


    > Message Posted By: Unknown
    >
    > I ran the command
    > (1)$ A B=C
    > CMD (Depth = 0):  SIMPLE,  argv[0] = A,  argv[1] = B=C
    >
    > The spec says that "we will assume that a TEXT token of the form
    > NAME=VALUE is always treated as a [local] if it can be." I expected B=C to
    > be treated as a local.
    >
    > In this case though, A B=C seems to be treated as a TEXT [suffix].
    >
    > Is this a mistake or should we assume that NAME=VALUE can somehow also be
    > a [suffix]?

As stated in the specification:

  [Local Variables] ...  Such assignments must precede the zero-th
  argument of the simple command or the opening left parenthesis of
  the subcommand.

This also follows from the grammar: A [local] may
only appear in a [prefix] and a [prefix] may only
appear before a TEXT.

--Stan-
PREV INDEX NEXT