From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: geoff.bache@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Weird stuff printed out by emacs rgrep Date: Sat, 21 Mar 2009 14:02:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9ed8d2c9-e755-4c7c-9176-e5e97769c0d2@w34g2000yqm.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1237671719 8773 80.91.229.12 (21 Mar 2009 21:41:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2009 21:41:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 22:43:16 2009 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.50) id 1Ll8yK-0007bx-53 for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Mar 2009 22:43:16 +0100 Original-Received: from localhost ([127.0.0.1]:50371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ll8wx-0001r1-Dx for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Mar 2009 17:41:51 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!w34g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: 83.227.50.117 Original-X-Trace: posting.google.com 1237669368 30072 127.0.0.1 (21 Mar 2009 21:02:48 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 21 Mar 2009 21:02:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w34g2000yqm.googlegroups.com; posting-host=83.227.50.117; posting-account=ZIEW3gkAAAC41ufTq9oYkvlXLYU5pgAQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167891 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:63183 Archived-At: Hi again, After a great deal of digging I have discovered why this happens. (It also happens with ordinary grep, not just rgrep, but does not happen with emacs 21 and earlier). I still don't really know what to do about it though. Emacs starts /bin/tcsh -c find ... | xargs grep ... Crucially, it sets the environment variable GREP_OPTIONS=3D' -- color=3Dalways' That means that anything in the various site-specific and personal shell starter scripts called when /bin/tcsh is called that wishes to make use of grep (and parse its output) will find it is parsing coloured output. Which of course it may well not expect. In my case I have Sun Grid Engine installed, which makes sure to set up a load of its own variables when a new shell is started. It was its starter script that was producing the strange error messages, which basically came from the fact it didn't know what to do with the coloured output when it called grep. Is this perhaps an emacs bug? It would seem perfectly possible to instead start something like /bin/tcsh -c "env GREP_OPTIONS=3D' --color=3Dalways' find ..." which would avoid the problem and any other similar potential problems. Regards, Geoff On Mar 19, 11:14=A0pm, Geoff Bache wrote: > Hi, > > Whenever I run M-x rgrep (which is a lot) I get exactly six lines of > > [: 320: Illegal number: 7 > [: 320: Illegal number: 7 > [: 320: Illegal number: 7 > [: 320: Illegal number: 7 > [: 320: Illegal number: 7 > [: 320: Illegal number: 7 > > printed between the find command and the output (which are both correct). > This seems to happen independently of the files and the search. Does anyo= ne know > what it means? It seems to refer to a file called '[', line 320, but > there is no file > with that name anywhere on my file system. > > It's not fatal but it's very annoying :) > > I'm running emacs 22.1.1 on Ubuntu (Hardy Heron) > > Thanks for any help, > Geoff