March 2002
Beginner
504 pages
10h 47m
English
Here is an echo command that must be modified because it contains many special shell characters:
$ echo <-$1250.**>; (update?) [y|n]
You could quote the entire string by putting a backslash in front of each special character, but this is tedious and makes the resulting command difficult to read and understand:
$ echo \<-\$1250.\*\*\>\;\(update\?\) \[y\|n\]
An alternative technique for quoting a large group of characters is to put a single quote (') at the beginning and end of the string. When a string is quoted using the single quote, all the meta-characters within the string lose their special meaning and are treated literally. For example, the following command is equivalent to the previous example:
$ echo '<-$1250.**>; ...
Read now
Unlock full access