echo variable returns blank

3171 views shell

Hi I am new to shell scripting and currently following tutorial on variables part 1. However, the script does not seem to echo the assigned value of the variable but a blank instead. Here is my script:

My_MESSAGE="Hello World"

I have seen similar questions and having trouble understanding the answers. Can someone kindly tell me how do I resolve this?

answered question

Gladly, Linux/UNIX is case dependant. it should be echo $My_MESSAGE.

I have tried: "$MY_MESSAGE" as mentioned by others while googling but that too does not seem to work.

Oh i just noticed it thank you for informing me

There is no such thing as "Unix/Linux scripting", see e.g. the description of the "shell" tag that you applied. Since you are using a very specific shell, that should be included as tag, since each shell has its own syntax. Also, that syntax is independent from the OS underneath.

1 Answer


You've spelt the variable wrong. Variables are case sensitive:

MY_MESSAGE="Hello World"

posted this

Have an answer?


Please login first before posting an answer.