I am a beginner in Unix commands as I am currently studying how to write scripts. However, I can't understand how to actually access a variable.
Suppose I have a variable called name ($name
), I see that sometimes people access it by using directly $name
, while others use ${name}
or even "$name"
. So this is very confusing, I am not sure what is the difference, as this is totally different from what I have learned in other programming languages.
Also, when I try to assign a string to a variable, do I write $name="happy"
, $name=happy
, "$name=happy"
or let "$name=happy"
.