I want to correctly export a variable. In order to do so I have to understand several variations in syntax. I've seen the following mechanisms of exporting a variable. In this case I am using
export MY_VARIABLE=USER/.gradle--No $
export $MY_VARIABLE=$USER/.gradle--All the $
What is the significance of the $ sign in these cases? Why is it sometimes used and other times not?
Do we need quotes in cases where there are no spaces in the path? What if the path is contained in $USER contains spaces?
Why no $ on the left hand side of export?