From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche Newsgroups: gmane.emacs.help Subject: grep-find oddity Date: Sun, 21 Mar 2010 23:38:01 -0400 Message-ID: <87pr2xt49y.fsf@pobox.com> Reply-To: help-gnu-emacs@gnu.org, Tom Roche NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269229119 30467 80.91.229.12 (22 Mar 2010 03:38:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 22 Mar 2010 03:38:39 +0000 (UTC) To: help-gnu-emacs@gnu.org, Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 22 04:38:34 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NtYTJ-00066W-Mp for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Mar 2010 04:38:34 +0100 Original-Received: from localhost ([127.0.0.1]:42208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NtYTJ-0005Kb-0u for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Mar 2010 23:38:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NtYSw-0005KN-4R for help-gnu-emacs@gnu.org; Sun, 21 Mar 2010 23:38:10 -0400 Original-Received: from [140.186.70.92] (port=56410 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NtYSt-0005KF-Q4 for help-gnu-emacs@gnu.org; Sun, 21 Mar 2010 23:38:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NtYSs-00007w-BX for help-gnu-emacs@gnu.org; Sun, 21 Mar 2010 23:38:07 -0400 Original-Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:52881 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NtYSs-00007r-99 for help-gnu-emacs@gnu.org; Sun, 21 Mar 2010 23:38:06 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 6E97A972D4; Sun, 21 Mar 2010 23:38:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:reply-to:date:message-id:mime-version:content-type; s= sasl; bh=kMQSvtOdKmBFcXnRE+1lJMpCsbY=; b=vC8QV+xSFfb4IWUdOK6kze1 Lw37AMcvycsykknAYUqAQ6cHPOq6VW75KYRrg4CrX241wGwj/d5KcYS+x1RTbyOa q4W72s7A0dm+BEgWpQrX4QA+JcMN+ETAM9idU2OCNS2KczjRd03qgSBgX08GE25P pNBJfnThpovMCLyH7YQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :reply-to:date:message-id:mime-version:content-type; q=dns; s= sasl; b=nUWLbQUfukk1h/ZvEpU0YX/Drzf90d3Wa+3NZrBkyUbpefmNqzP3VvW1 XRmkA6kK6YAtKoPjz7urhEevEvCBeMqiNaGB5zTTOYCKi84k/zLqSl8QKslO9vgJ 8pPf2ECtrA1SbFkfX2HF8OdfXNr1eyFDAUyez/ahTd8EnCxZzG4= Original-Received: from b-pb-sasl-quonix. (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 5D389972D3; Sun, 21 Mar 2010 23:38:03 -0400 (EDT) Original-Received: from tlrPanP5.pobox.com (unknown [69.134.240.67]) by b-sasl-quonix.pobox.com (Postfix) with ESMTPA id BF368972D2; Sun, 21 Mar 2010 23:38:01 -0400 (EDT) User-Agent: GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) X-Pobox-Relay-ID: 52062328-3564-11DF-94D9-68E3016DD5F0-07218935!b-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72442 Archived-At: I'm running ubuntu=karmic package=emacs-snapshot, which is GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) of 2009-09-27 on crested, modified by Debian When I do M-x grep-find with the argument find . -type f -name '*.10*' -print0 | xargs -0 -e grep -nH -e '' I get *grep* > -*- mode: grep; default-directory: "~/info/logs/" -*- > Grep started at Sun Mar 21 23:27:38 > > find . -type f -name '*.10*' -print0 | xargs -0 -e grep -nH -e '' > ./logfile.100103:326: > ./logfile.100110:529: > ./logfile.100117:217: > ./logfile.100124:186: > ./logfile.100131:387: > ./logfile.100207:836: > ./logfile.100307:265: > ./logfile.100214:271: > ./logfile.100221:402: > ./logfile.100314:488: > ./logfile.100228:311: > ./logfile.100321:731: > > Grep finished (matches found) at Sun Mar 21 23:27:38 which I expect. But when I try to do M-x grep-find with a nearly equivalent but slightly more complex argument find . -type f -name '*.10*' -print0 | sort | xargs -0 -e fgrep -nH -e '' I get *grep* > -*- mode: grep; default-directory: "~/info/logs/" -*- > Grep started at Sun Mar 21 23:23:15 > > find . -type f -name '*.10*' -print0 | sort | xargs -0 -e fgrep -nH -e '' > ./logfile.100103:326: > ./logfile.100110:529: > ./logfile.100117:217: > ./logfile.100124:186: > ./logfile.100131:387: > ./logfile.100207:836: > ./logfile.100307:265: > ./logfile.100214:271: > ./logfile.100221:402: > ./logfile.100314:488: > ./logfile.100228:311: > ./logfile.100321:731: > fgrep: > : No such file or directory > > Grep exited abnormally with code 123 at Sun Mar 21 23:23:15 The latter seems wrong: - output is unsorted: same 12 results, no change in order - fgrep gets error (though it's in the path, works fine from xterm) - grep exits abnormally So I'm wondering: 0 Why does grep-find behave like this? 1 What should I do to process a more complex pipeline, but otherwise get grep-find behavior (i.e. present results in a buffer from which I can navigate to results)? Apologies if this is a FAQ, but I didn't see anything in the *info* (node=emacs, page=31.4 Searching with Grep under Emacs). TIA, Tom Roche