To illustrate this better I will first present the echo command. The command is simple, but still very useful. It will print back whatever string you throw at it as arguments. The rule is to take the first argument, add a space to it, add the second argument, and add a space to it and so on. Add to the end a new line character and print it in the output. In the end, every argument will be split from the rest by exactly one space.
echo This is a message
This is a message
The echo command has two notable options. Adding the -n will let no new line character be added to the end. The -e will allow the interpreting the following special characters inside the arguments:
a => bell
b => delete a character backwards (backspace)
c => don't print out new line character
f => throw page
n => new line
r => carriage return
t => horizontal tab
v => vertical tab
=> backslash
nnn => The octal ASCI code of the character
xnn => The hexadecimal ASCI code of the character
Now let us return to the quotes. There are three types, as follows: " ' `. The first is the double quote ("). We use this to define strings. With the help of these, we can delimit what is a string.
echo "alfa beta" omega
The upper command will contain only arguments. The "alfa beta" will form a single string, as a single argument. The shell will treat it as a simple string and will not use inside-the-shell meta-characters, like the space that delimits arguments. This is a good way to insert more than one space, for example, inside a string. However, the shell will still change the variables with their values.
echo "$color hearth"
Will echo back to the terminal:
red hearth
Sometimes you do not want this. Maybe you really want to print the $ sign. In this case you can use the single quite ('). You may also know this as the forward tick. What you surround with this will lose all of its meta-character meaning, and the shell will make no changes to it.
echo 'I am rich $Color $$*'
Will echo back just that:
I am rich $Color $$*
The third used quote mark is the back tick (`). This is used to store command outputs in variables. The example below will give you a taste of it; however, I will cover it in more detail in a future article.
color='echo red'
This will store, inside the variable, the return string of the command between the quotes; for now, that is the word "red."