[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 14:18:24 -0800

    >     When I run grep 'epsilon\($\)' foo
    >     from the shell, it finds a match. What does your grep do?
    > I said:
    >   And if I run grep from the Cygwin command line (with either
    >   parenthetical regexp - single or double backslashes), it
    >   works OK. I only have the problem when I use `call-process'.
    > By command line, I meant shell (bash from Cygwin). (I showed
    > the regexp with double-quotes, but single-quotes work too.)
    > Summary: grep works with that regexp when run from the shell
    > or when using the Emacs `grep' command. The only problem is
    > with `call-process'.

    The quotes are not part of the regex, and are only necessary
    when running the command via a shell (`M-x grep' uses

    The correct way to use call-process would be:

    (call-process "grep" nil BUFFER nil "epsilon\\($\\)" "foo")

Uh, isn't that what I wrote(?):

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

This does *not* work for me. That's the point - that is the code I started
with. It works if I change \\($\\) to $ (but that's not what I need in the
general case).

(And yes, I realize that the quotes are not part of the regexp. By "I showed
the regexp with double-quotes" I meant that I showed it enclosed in

reply via email to

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