I was doing something very simple like: v=5 echo \"$v\" and expected it to print 5. However, it does not. The value that was just set is not availa
v=5 echo $v
will add v=5 into the environment variables and then execute echo $v. The $v refers to the shell variable v which you have set to 1 in the first line.
Adding the semi colon v=5;echo $v sets the shell variable to 5 and then executes the command after the semi-colon ie echo $v and produces 5.
Try this command:
v=5 env|less
and look at the environment.