What exactly is happening in the below bash incantation?
x=10 echo $x
I was under the impression that commands on bash can be chained using &&
, ||
or ;
but not simply separated by white-space. The above only works if the first command is an assignment. E.g. ls ls
fails but foo=zoo ls
works just fine.
A real case of the above style is found in this SO answer.