From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: rgrep on Windows with ezwinports. Shell quoting problem. Date: Tue, 24 Dec 2013 16:17:26 +0100 Message-ID: <87ppom8eih.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387898880 12135 80.91.229.3 (24 Dec 2013 15:28:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 15:28:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 16:28:05 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvTsn-0004RE-VK for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 16:26:58 +0100 Original-Received: from localhost ([::1]:39114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvTsn-0005nL-Ex for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 10:26:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvTsW-0005mw-AV for help-gnu-emacs@gnu.org; Tue, 24 Dec 2013 10:26:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvTsO-0007tx-WA for help-gnu-emacs@gnu.org; Tue, 24 Dec 2013 10:26:40 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvTsO-0007tY-Pn for help-gnu-emacs@gnu.org; Tue, 24 Dec 2013 10:26:32 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VvTsL-0003uq-SI for help-gnu-emacs@gnu.org; Tue, 24 Dec 2013 16:26:29 +0100 Original-Received: from 192.red-83-41-60.dynamicip.rima-tde.net ([83.41.60.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Dec 2013 16:26:29 +0100 Original-Received: from ofv by 192.red-83-41-60.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Dec 2013 16:26:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 192.red-83-41-60.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:3mNjZ1kRDEfajApsXAA8R+2FiSs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95148 Archived-At: After trying with findutils/grep from GnuWin32 and MSYS without success, using the binaries from http://sourceforge.net/projects/ezwinports/files/ works with this config: (setq find-program "d:/ez/bin/find") (setq xargs-program "d:/ez/bin/xargs") (setq grep-program "d:/ez/bin/grep") but there are some issues. The lesser one is that the pattern "*" for files does not cover those with extension (i.e. something like foo.cpp is not matched) so one must use "*.*". The most serious problem is that the rgrep output comes with lots of warnings of this type: d:/ez/bin/find: warning: Filenames usually don't contain slashes (though pathnames do). That means that '-name *.bin\ ' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ *.bin\ '. The above is a literal cut&paste from the output, which includes a newline after ``*.bin\''. As shown on the *grep* buffer, the command executed by rgrep is like this: d:/ez/bin/find . [...] -o -name "*.bin" [...] So at some point "*.bin" is translated to *.bin\[newline] Directly pasting the command from the *grep* buffer into a Windows Shell box works fine (after replacing d:/ez/bin/ with d:\ez\bin\). So the problem is with Emacs modifying the command generated by rgrep before passing it to the shell for execution. How can I prevent that change?