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
Put simply, the "$v" is evaluated before the command is called while prepending "v=5" in front of the command modifies the environment of the command you're running.
As Charles Duffy said, you can add an intermediate 'sh' process that will evaluate the variable with a similar syntax but you probably want to do something a bit more elaborate and it'd be useful to know what if you still have troubles with it.