[Top][All Lists]

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

RE: problem using call-process with grep

From: Drew Adams
Subject: RE: problem using call-process with grep
Date: Fri, 23 Dec 2005 16:42:21 -0800

    >     maybe what arrives at the application level is gamma(,) without
    >     backslashes
    > Bingo!  Thank you, David.
    > Don't know why I didn't see this before. I just need to use
    > "\\\\" to get \, as is usual with a Lisp string (which
    > this is). Sorry for wasting time.

    Uh, there is still something wrong here.  You wrote:

    >     >  (call-process "grep" nil
    >     >                (generate-new-buffer "Result")
    >     >                nil "epsilon\\($\\)" "foo")
    >     >

    This means that the string is 'epsilon\($\)', and call-process is
    supposed to pass this unmolested into grep.  So some other entity is
    removing a level of backslashes that shouldn't.  It is either
    call-process, or grep itself.

Hm, you're right. It's as if we had to supply a regexp that would match the
literal string `\('. The Lisp string to do that would be "\\\\(". I just
re-read the doc for `grep' and `call-process'; neither mentions anything
about this.

To figure out whether this is specific to Cygwin `grep' or a property of
`call-process', could someone else (e.g. on GNU/Linux) please try these:

 (call-process "/path/to/your/echo" nil t nil  "foo\\\\(bar\\\\)")

 (call-process "/path/to/your/echo" nil t nil  "foo\\(bar\\)")

In my case, the first gives: foo\(bar\); the second gives foo(bar).

reply via email to

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