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 1M2Qlj-0008F3-LW for garchives@archives.gentoo.org; Fri, 08 May 2009 14:09:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D1BCAE027D; Fri, 8 May 2009 14:09:41 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id 95EF2E027D for ; Fri, 8 May 2009 14:09:41 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.40,317,1238972400"; d="scan'208";a="91666792" Received: from unknown (HELO compaq.stroller.uk.eu.org) ([213.152.39.90]) by smtpout.karoo.kcom.com with ESMTP; 08 May 2009 15:09:40 +0100 Received: from [192.168.1.71] (unknown [192.168.1.71]) by compaq.stroller.uk.eu.org (Postfix) with ESMTP id 87A2E137CC1 for ; Fri, 8 May 2009 15:09:37 +0100 (BST) Message-Id: From: Stroller To: gentoo-user@lists.gentoo.org In-Reply-To: <20090508200114.5edbc580@coercion> 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: Fri, 8 May 2009 15:09:36 +0100 References: <742F0C43-196E-465B-9991-3DFF1C655803@stellar.eclipse.co.uk> <20090508200114.5edbc580@coercion> X-Mailer: Apple Mail (2.930.3) X-Archives-Salt: 95529a8a-6eed-47b2-aaa0-e285fa4ab32c X-Archives-Hash: 2db284b4d13834207363a43b3664a8f2 On 8 May 2009, at 15:01, Mike Kazantsev wrote: > On Fri, 8 May 2009 14:38:58 +0100 > Stroller wrote: > >> 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? > > Some greps (like BSD one) might not support '--color' option, so "echo > hello|grep --color=auto l" will return error code, skipping if clause, > and won't break grep operation by adding an unsupported option. Ah! I see! Many thanks! Stroller.