unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: problem using call-process with grep
Date: Fri, 23 Dec 2005 14:18:24 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICCELFDAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <dohs4u$q2$1@sea.gmane.org>

    >     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
    start-process-shell-command).

    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
double-quotes.)

  reply	other threads:[~2005-12-23 22:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <MEEKKIABFKKDFJMPIOEBOEBLCOAA.drew.adams@oracle.com>
2005-12-23  6:45 ` problem using call-process with grep Drew Adams
2005-12-23 18:11   ` Richard M. Stallman
2005-12-23 18:24     ` Drew Adams
2005-12-23 22:02       ` Kevin Rodgers
2005-12-23 22:18         ` Drew Adams [this message]
2005-12-23 22:42           ` David Kastrup
2005-12-23 23:16             ` Drew Adams
2005-12-23 23:20               ` David Kastrup
2005-12-23 23:44                 ` Drew Adams
2005-12-23 23:52                   ` David Kastrup
2005-12-24  0:42                     ` Drew Adams
2005-12-24  4:48                       ` Giorgos Keramidas
2005-12-24 16:32       ` Richard M. Stallman
2005-12-24 16:35         ` Drew Adams
2005-12-24 16:57           ` Eli Zaretskii
2005-12-24 17:08             ` Drew Adams
2005-12-24 17:35               ` Eli Zaretskii
     [not found] <jku0cz1e9l.fsf@glug.org>
2005-12-24  1:51 ` Drew Adams
2005-12-24 11:56   ` Eli Zaretskii
2005-12-24 15:48     ` Drew Adams
2005-12-24 16:36       ` Eli Zaretskii
2005-12-24 16:39         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICCELFDAAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).