4.1 Assigning data to variables
Any string can be stored in a variable by using the operator = without spaces before and after, if spaces are added between the operator “=” an error will be prompt.
You must use quotes (“) to include spaces.
Use backslashes (\) to escape special characters that shoudl not be interpreted, such as a double quote in the next example:
$ c="Be careful with "!"
$ c="Be careful with \"!"
bash: -c: line 2: unexpected EOF while looking for matching `"'Note that on a Mac, the above lines will not work due to the exclamation mark. If you want to run it, use single quotes instead of double quotes. In the above case, this also eliminates the issue of escaping:
Unless you want to warn of single quotes, of course:
Single quotes and double quotes have different meaning, however. We will delve into that below