15.1. The need for quoting

We will cover only the basic rules of quoting here, because there are plenty of examples of when to use quoting and what it achieves in the next two parts of the book.

When the shell reads the lines in your scripts, it will try to do its own evaluation of the assignments you have made. You need a way to stop the shell from doing this. The methods available are by using quotes, different kinds of quotes, and using a backslash.

Some users do not bother to use double quotes when echoing strings of text. If they did half their quoting problems would go away. I recommend you always to use double quotes when echoing strings of text. Here’s an example before we begin on the different quotes.

						$ echo Hit the star button to ...

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.