O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required