O padrão POSIX diz o seguinte:
3.229 Name
In the shell command language, a word consisting solely of underscores, digits, and
alphabetics from the portable character set. The first character of a name is not a digit.
Na seção padrão POSIX das Regras gramaticais do shell, ele diz:
2.10.2 Regras gramaticais de shell
7. [Assignment preceding command name]
a. [When the first word]
If the TOKEN does not contain the character ’=’, rule 1 is applied.
Otherwise, 7b shall be applied.
b. [Not the first word]
If the TOKEN contains the equal sign character:
— If it begins with ’=’, the token WORD shall be returned.
— If all the characters preceding ’=’ form a valid name (see XBD Section 3.229, |
on page 65), the token ASSIGNMENT_WORD shall be returned. (Quoted
characters cannot participate in forming a valid name.)
— Otherwise, it is unspecified whether it is ASSIGNMENT_WORD or WORD
that is returned.
Assignment to the NAME shall occur as specified in Section 2.9.1 (on page 2263).
Como o nome da variável contém caracteres inválidos, ele não tenta a atribuição, mas a trata como um comando simples.