Difference between setting a variable in a command vs setting variable before the command

Viewed 25

Why does in the second case, the value is not used by the command followed?

$ x=1
$ echo $x
1
$ x=2 echo $x
1
0 Answers
Related