public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] 'if echo hello' in .bashrc
@ 2009-05-08 13:38 Stroller
  2009-05-08 14:01 ` Mike Kazantsev
  2009-05-09 10:15 ` Stroller
  0 siblings, 2 replies; 19+ messages in thread
From: Stroller @ 2009-05-08 13:38 UTC (permalink / raw
  To: gentoo-user

Hi there,

I've just realised that grep hasn't been highlighting results in  
colour, and it occurred to me that I was sure it has supported this  
facility for some time. Thus I discovered the --colour=always flag to  
grep and trying to make this permanent I stumbled upon this site: http://www.ccs.neu.edu/home/katz/unix-colors.html

To find the part to which I refer you'll need to scroll down about  
halfway through that page to "Colorize grep"; the author advises adding:

   if echo hello|grep --color=auto l >/dev/null 2>&1; then
     export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
   fi

to ~/.bashrc

Why does he echo hello, please?  Is this to ensure that the file is  
not sourced by a non-interactive shell, or by a script or something? I  
understood that that was the difference between .bashrc  
& .bash_profile, anyway - that "interactive commands" like colourising  
stuff should go in .bashrc, to use /usr/local/mount instead of the  
system on then one might alias that in .bash_profile.

It's early in the morning here, so obviously I'm not getting something.

Thanks in advance for any pointers,

Stroller.





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-05-09 14:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-05-09 11:38   ` Mike Kazantsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox