all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: geoff.bache@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: Weird stuff printed out by emacs rgrep
Date: Sat, 21 Mar 2009 14:02:47 -0700 (PDT)	[thread overview]
Message-ID: <9ed8d2c9-e755-4c7c-9176-e5e97769c0d2@w34g2000yqm.googlegroups.com> (raw)
In-Reply-To: mailman.3609.1237522114.31690.help-gnu-emacs@gnu.org


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	other threads:[~2009-03-21 21:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3609.1237522114.31690.help-gnu-emacs@gnu.org>
2009-03-21 21:02 ` geoff.bache [this message]
2009-03-21 22:32   ` Weird stuff printed out by emacs rgrep Drew Adams
2009-03-21 23:01   ` Eli Zaretskii
     [not found]   ` <mailman.3759.1237676491.31690.help-gnu-emacs@gnu.org>
2009-03-22 18:23     ` geoff.bache
2009-03-22 19:08       ` Eli Zaretskii
     [not found]       ` <mailman.3789.1237749011.31690.help-gnu-emacs@gnu.org>
2009-03-22 19:55         ` geoff.bache
2009-03-22 21:48           ` Eli Zaretskii
     [not found]           ` <mailman.3799.1237758495.31690.help-gnu-emacs@gnu.org>
2009-03-23 18:25             ` geoff.bache
2009-03-19 22:14 Geoff Bache

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ed8d2c9-e755-4c7c-9176-e5e97769c0d2@w34g2000yqm.googlegroups.com \
    --to=geoff.bache@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.