
03-27-04, 10:05
|
|
Registered User
|
|
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
|
|
The difference is at shell level, not at grep level.
Quote:
Certain programs and utilities can still reinterpret or expand special characters in a quoted string. This is an important use of quoting, protecting a command−line parameter from the shell, but still letting the calling program expand it.
When referencing a variable, it is generally advisable in enclose it in double quotes (" "). This preserves all special characters within the variable name, except $, ` (backquote), and \ (escape). [14] Keeping $ as a special character within double quotes permits referencing a quoted variable ("$variable"), that is, replacing the variable with its value
Use double quotes to prevent word splitting. [15] An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators.
Single quotes (' ') operate similarly to double quotes, but do not permit referencing variables, since the special meaning of $ is turned off. Within single quotes, every special character except ' gets interpreted literally.
Consider single quotes ("full quoting") to be a stricter method of quoting than double quotes ("partial
quoting").
|
__________________
Jean-Pierre.
|
|