|
Shell scripts can take advantage of the special meanings given to certain characters. Useful special characters are:
You can turn off the meaning of special characters by enclosing them in quotes. Double quotes and single quotes have different effects. Double quotes turn off some special characters, but allow the substitution of variables values. Single quotes turn off all special characters, allowing no variable substitution, as shown by the following commands: city="San Diego" echo $city "$city" '$city' San Diego San Diego $city As you can see, the single quotes turn off the $ and echo the literal characters between the quotes. You can tell the shell to treat a special character as a literal by preceding it with a back slash, as follows: echo \$city $city |
|