help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handling parenthesis and quotes


From: Harald Hanche-Olsen
Subject: Re: handling parenthesis and quotes
Date: Wed, 24 Jan 2007 08:24:51 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Adam <nospam@example.com>:

| Giorgos Keramidas wrote:
|
|> AFAIK, you can `escape' the quotes, with:
|> 
|>   (shell "grep -i \"(define \" ~/mydir/myfile?.lisp")
|
| That's got it, Giorgos.  Thank you. 
| Seems I didn't escape often enough.
|
| (shell "grep -i \"\(define \" ~/mydir/myfile?.lisp")

Much easier to use the single quote for the shell command.  It does
not need to be escaped within the emacs string (and escaping the
parenthesis seems pointless BTW):

(shell "grep -i 'define ' ~/mydir/myfile?.lisp")

Of course, sometimes shell syntax demands double quotes and then you
must escape those: as in "$foo" vs '$foo'.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

[Prev in Thread] Current Thread [Next in Thread]