help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: grep-find oddity


From: Eli Zaretskii
Subject: Re: grep-find oddity
Date: Mon, 22 Mar 2010 06:07:15 +0200

> From: Tom Roche <Tom_Roche@pobox.com>
> Date: Sun, 21 Mar 2010 23:38:01 -0400
> 
> 
> 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

Try "sort -z" instead of just "sort".  By default, `sort' assumes
lines are separated by newlines, not by null characters.





reply via email to

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