5.16. QuotingThere are often times when you want to inhibit the shell's wildcard-replacement, variable-substitution, and/or command-substitution mechanisms. The shell's quoting system allows you to do just that. Here's the way it works:
The following example illustrates the difference between the two different kinds of quotes: $ echo 3 * 4 = 12 ...remember, * is a wildcard. 3 a.c b.c c.c 4 = 12 $ echo "3 * 4 = 12" ...double quotes inhibit wildcards. 3 * 4 = 12 $ echo '3 * 4 = 12' ...single quotes inhibit wildcards. 3 * 4 = 12 $ name=Graham By using single quotes (apostrophes) around the text, we inhibit all wildcarding, variable, and command substitutions: $ echo 'my name is $name - date is `date` ' my name is $name and the date is `date` By using double quotes around the text, we inhibit wildcarding, but allow variable and command substitutions: $ echo "my name is $name - date is `date`" my name is Graham - date is Wed Feb 2 23:14:56 CST 2005 $ _ |