The shell assigned the entire string. Then, when you ran:
$cmd
The shell expanded the string, and tries to execute the first word, using the remaining words as arguments. Thus, you get:
echo ONE; echo TWO; echo THREE;
This occurs because your command is a simple command expansion:
man bash:
Quote:
SIMPLE COMMAND EXPANSION
When a simple command is executed, the shell performs the following
expansions, assignments, and redirections, from left to right.
1. The words that the parser has marked as variable assignments
(those preceding the command name) and redirections are saved
for later processing.
2. The words that are not variable assignments or redirections are
expanded. If any words remain after expansion, the first word
is taken to be the name of the command and the remaining words
are the arguments.
|