all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* grep-find oddity
@ 2010-03-22  3:38 Tom Roche
  2010-03-22  4:07 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Roche @ 2010-03-22  3:38 UTC (permalink / raw)
  To: help-gnu-emacs


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 '<respiratory>'

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 '<respiratory>'
> ./logfile.100103:326:<respiratory>
> ./logfile.100110:529:<respiratory>
> ./logfile.100117:217:<respiratory>
> ./logfile.100124:186:<respiratory>
> ./logfile.100131:387:<respiratory>
> ./logfile.100207:836:<respiratory>
> ./logfile.100307:265:<respiratory>
> ./logfile.100214:271:<respiratory>
> ./logfile.100221:402:<respiratory>
> ./logfile.100314:488:<respiratory>
> ./logfile.100228:311:<respiratory>
> ./logfile.100321:731:<respiratory>
>
> 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 '<respiratory>'

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 '<respiratory>'
> ./logfile.100103:326:<respiratory>
> ./logfile.100110:529:<respiratory>
> ./logfile.100117:217:<respiratory>
> ./logfile.100124:186:<respiratory>
> ./logfile.100131:387:<respiratory>
> ./logfile.100207:836:<respiratory>
> ./logfile.100307:265:<respiratory>
> ./logfile.100214:271:<respiratory>
> ./logfile.100221:402:<respiratory>
> ./logfile.100314:488:<respiratory>
> ./logfile.100228:311:<respiratory>
> ./logfile.100321:731:<respiratory>
> 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 <Tom_Roche@pobox.com>




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-22 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22  3:38 grep-find oddity Tom Roche
2010-03-22  4:07 ` Eli Zaretskii
2010-03-22 16:56   ` Tom Roche
2010-03-22 17:49     ` Suvayu Ali

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.