From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1M2QIF-0001hS-Fl for garchives@archives.gentoo.org; Fri, 08 May 2009 13:39:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6450DE03D8; Fri, 8 May 2009 13:39:13 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id 27815E03D8 for ; Fri, 8 May 2009 13:39:13 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.40,315,1238972400"; d="scan'208";a="96212708" Received: from unknown (HELO compaq.stroller.uk.eu.org) ([213.152.39.90]) by smtpout.karoo.kcom.com with ESMTP; 08 May 2009 14:39:11 +0100 Received: from [192.168.1.71] (unknown [192.168.1.71]) by compaq.stroller.uk.eu.org (Postfix) with ESMTP id 01BB7137BF2 for ; Fri, 8 May 2009 14:39:08 +0100 (BST) Message-Id: <742F0C43-196E-465B-9991-3DFF1C655803@stellar.eclipse.co.uk> From: Stroller To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 (Apple Message framework v930.3) Subject: [gentoo-user] 'if echo hello' in .bashrc Date: Fri, 8 May 2009 14:38:58 +0100 X-Mailer: Apple Mail (2.930.3) X-Archives-Salt: 7308e2bd-c1d5-48a1-b171-fd444499d1ca X-Archives-Hash: d3ffebae053bd6db53b8b5ee1bf39d29 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.