If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > diff between ' and "

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-27-04, 07:55
getmathan getmathan is offline
Registered User
 
Join Date: Feb 2004
Location: Chennai
Posts: 53
diff between ' and "

i have a small doubt.
is the any diff between using a ' and " in find and grep commands????
__________________
-Mathan
For a quick pocket reference of oracle refer http://pocketoracle.*************/
Reply With Quote
  #2 (permalink)  
Old 03-27-04, 10:05
aigles aigles is offline
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.
Reply With Quote
  #3 (permalink)  
Old 03-27-04, 12:17
getmathan getmathan is offline
Registered User
 
Join Date: Feb 2004
Location: Chennai
Posts: 53
Thanks
__________________
-Mathan
For a quick pocket reference of oracle refer http://pocketoracle.*************/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On