public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] 'if echo hello' in .bashrc
Date: Sat, 09 May 2009 16:38:36 +0200	[thread overview]
Message-ID: <4a05956c.KywRfacLm4J2fTJF%Joerg.Schilling@fokus.fraunhofer.de> (raw)
In-Reply-To: <200905091241.51424.shrdlu@unlimitedmail.org>

Etaoin Shrdlu <shrdlu@unlimitedmail.org> wrote:

> On Saturday 9 May 2009, 12:15, Stroller wrote:
> > On 8 May 2009, at 14:38, Stroller wrote:
> > > ...
> > >  if echo hello|grep --color=auto l >/dev/null 2>&1; then
> > >    export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
> > >  fi
> >
> > I'm afraid this thread has run away from me. I'm drinking the day's
> > first cup of tea & rubbing my eyes furiously in confusion. Wha?
> > I'm sure I'll comprehend the discussion better when I re-read later.
> > However, is there actually any need to parse whether the grep supports
> > colour before setting it?
> >
> > Let's say we use BSD grep or Schilling grep or whatever - is there
> > actually any harm in exporting GREP_OPTIONS='--color=auto' in this
> > case?
>
> Yes, because if the grep implementation in question supports GREP_OPTIONS 
> but doesn't support --color, you'll get errors when it's run.

My "grep" is called "match" and it does not look at environment variables.

There are few commands that have codumented (by POSIX) environment variables for
options. I think of e.g. "make", that needs this in order to pass options to
sub-makes.

A safe method in shell scripts is to use lower case variable names.....

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



  parent reply	other threads:[~2009-05-09 14:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08 13:38 [gentoo-user] 'if echo hello' in .bashrc Stroller
2009-05-08 14:01 ` Mike Kazantsev
2009-05-08 14:09   ` Stroller
2009-05-08 14:10   ` Alan McKinnon
2009-05-08 14:38     ` Christian
2009-05-08 14:43       ` Alan McKinnon
2009-05-08 14:57     ` Eray Aslan
2009-05-08 14:59     ` Etaoin Shrdlu
2009-05-08 14:51       ` Alan McKinnon
2009-05-08 15:13         ` Etaoin Shrdlu
2009-05-08 16:22     ` Carlos Hendson
2009-05-08 18:08       ` James Rowe
2009-05-08 18:05     ` Mike Kazantsev
2009-05-09 10:15 ` Stroller
2009-05-09 10:41   ` Etaoin Shrdlu
2009-05-09 10:43     ` Stroller
2009-05-09 11:13       ` Etaoin Shrdlu
2009-05-09 14:38     ` Joerg Schilling [this message]
2009-05-09 11:38   ` Mike Kazantsev

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=4a05956c.KywRfacLm4J2fTJF%Joerg.Schilling@fokus.fraunhofer.de \
    --to=joerg.schilling@fokus.fraunhofer.de \
    --cc=gentoo-user@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox