If I type in the following two commands:
i=1
var$i=2014
I get an error message var1=2014: command not found
.
I have found how to make dynamic variable names possible with declare
in this SO post, but I still wondering about why that error message is generated. It implies that bash consider var1=2014
as a command/executable name instead of an assignment, and the if this line is an assignment
test happened before the $i
expansion.
Qustion:
What order does bash follow parsing an input line w.r.t. assignments?
Any recommended reading is also appreciated.