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 1M2jah-0000SK-Lo for garchives@archives.gentoo.org; Sat, 09 May 2009 10:15:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6750AE02B4; Sat, 9 May 2009 10:15:34 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id 29338E02B4 for ; Sat, 9 May 2009 10:15:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.40,320,1238972400"; d="scan'208";a="91828706" Received: from unknown (HELO compaq.stroller.uk.eu.org) ([213.152.39.90]) by smtpout.karoo.kcom.com with ESMTP; 09 May 2009 11:15:33 +0100 Received: from [192.168.1.71] (unknown [192.168.1.71]) by compaq.stroller.uk.eu.org (Postfix) with ESMTP id 48FE3137CC0 for ; Sat, 9 May 2009 11:15:30 +0100 (BST) Message-Id: <5E74755A-7D9B-4286-B1B1-91735F1F7C07@stellar.eclipse.co.uk> From: Stroller To: gentoo-user@lists.gentoo.org In-Reply-To: <742F0C43-196E-465B-9991-3DFF1C655803@stellar.eclipse.co.uk> 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: Re: [gentoo-user] 'if echo hello' in .bashrc Date: Sat, 9 May 2009 11:15:30 +0100 References: <742F0C43-196E-465B-9991-3DFF1C655803@stellar.eclipse.co.uk> X-Mailer: Apple Mail (2.930.3) X-Archives-Salt: 5f68a04f-19d1-425f-82e1-933e23050255 X-Archives-Hash: 4ac7af0d1269c34e3453780b1168eca8 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? Having written the above (so I might as well now send this message) it occurred to me to test it: $ GREP_OPTIONS='--not-suported' $ grep -i rabbit Alice\ in\ Wonderland.txt grep: unrecognized option '--not-suported' Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. $ Presumably BSD grep & all other greps also support the GREP_OPTIONS environment variable? Stroller