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 1M2joJ-0001t7-Gw for garchives@archives.gentoo.org; Sat, 09 May 2009 10:29:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCEA6E0253; Sat, 9 May 2009 10:29:37 +0000 (UTC) Received: from dcnode-02.unlimitedmail.net (smtp.unlimitedmail.net [94.127.184.242]) by pigeon.gentoo.org (Postfix) with ESMTP id 714EEE0253 for ; Sat, 9 May 2009 10:29:37 +0000 (UTC) Received: from ppp.zz ([137.204.208.98]) (authenticated bits=0) by dcnode-02.unlimitedmail.net (8.14.3/8.14.3) with ESMTP id n49ATRm6019584 for ; Sat, 9 May 2009 12:29:27 +0200 From: Etaoin Shrdlu To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] 'if echo hello' in .bashrc Date: Sat, 9 May 2009 12:41:51 +0200 User-Agent: KMail/1.9.9 References: <742F0C43-196E-465B-9991-3DFF1C655803@stellar.eclipse.co.uk> <5E74755A-7D9B-4286-B1B1-91735F1F7C07@stellar.eclipse.co.uk> In-Reply-To: <5E74755A-7D9B-4286-B1B1-91735F1F7C07@stellar.eclipse.co.uk> 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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905091241.51424.shrdlu@unlimitedmail.org> X-UnlimitedMail-MailScanner-From: shrdlu@unlimitedmail.org X-Spam-Status: No X-Archives-Salt: c093a680-f150-442d-9de6-f7c2bf78b8ef X-Archives-Hash: 47f572732d83270f3de5fde27fed5d4c 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. (The assumption the author made is that if --color is supported, then GREP_OPTIONS is too, which is reasonable and is what happens for GNU grep, although I cannot speak for other implementations).