You're making a mistake of thinking that the script interpreter reads separated commands left to right. It reads things from right to left(so that expressions are evaluated before going into a variable) and then from the top line to the bottom.
Example 1:
var=1
var=2
var=3
var=4
Result is that var == 4
Example 2:
var=1 var=2 var=3 var=4
Result is that var == 1
Example 3:
var=1
var=2
var=3
var=4
Result is that var == 4
Example 3 works as a single line because "
" are XML entities for "\r\n". (A carriage return and a new line)
|