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

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

Re: Weird stuff printed out by emacs rgrep


From: geoff . bache
Subject: Re: Weird stuff printed out by emacs rgrep
Date: Sat, 21 Mar 2009 14:02:47 -0700 (PDT)
User-agent: G2/1.0

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=' --
color=always'

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=' --color=always' find ..."
which would avoid the problem and any other similar potential
problems.

Regards,
Geoff

On Mar 19, 11:14 pm, Geoff Bache <geoff.ba...@gmail.com> 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 anyone 
> 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



reply via email to

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