The following shell command requires no explanation
a=1
However, when an extra space is added, zsh gives an unexpected error
a =1
zsh: 1 not found
Could someone explain this, please? What is the meaning of ‘=’ is zsh?
Bash produces an error that I expected:
a =1
bash: a: command not found
>Solution :
The fine manual says:
`=' expansion
If a word begins with an unquoted `=' and the EQUALS option
is set, the remainder of the word is taken as the name of
a command. If a command exists by that name, the word is
replaced by the full pathname of the command.
Thus:
%echo =ls
/bin/ls