View Single Post
  #5   (View Single Post)  
Old 8th March 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by gosha View Post
why?
Recognize that the command is being passed from the shell to sed, & each consumes a leading backslash as an "escape" if given the chance. The reason single quotes works is because this tells the shell that the enclosed string is to be passed to sed as is without the shell consuming the leading backslash(s).

In other words, enclosing the argument in single quotes actually passes the necessary information on to sed.
Reply With Quote