if [ "$FOO" = "true" ]; then
if [ $FOO = "true" ]; then
What is the different? Seems both of two statements also works.
migrated from serverfault.com Aug 14 '13 at 22:09
This question came from our site for system and network administrators.
If the value of
In this specific case there is no difference.
However, if you use
To illustrate what problems it might cause, here a few examples.
Let's say we have two variables as follow:
Now we have two variables holding exactly the same string/value. If we did some if statements to test the result, in your case:
At this point you will get
When we quote "$FOO" we explicitly tell
Hope I've not confused you with these examples.