Gentoo Archives: gentoo-user

From: Mike Kazantsev <mike_kazantsev@×××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] 'if echo hello' in .bashrc
Date: Fri, 08 May 2009 14:04:21
Message-Id: 20090508200114.5edbc580@coercion
In Reply to: [gentoo-user] 'if echo hello' in .bashrc by Stroller
1 On Fri, 8 May 2009 14:38:58 +0100
2 Stroller <stroller@××××××××××××××××××.uk> wrote:
3
4 > To find the part to which I refer you'll need to scroll down about
5 > halfway through that page to "Colorize grep"; the author advises adding:
6 >
7 > if echo hello|grep --color=auto l >/dev/null 2>&1; then
8 > export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
9 > fi
10 >
11 > to ~/.bashrc
12 >
13 > Why does he echo hello, please?
14
15 Some greps (like BSD one) might not support '--color' option, so "echo
16 hello|grep --color=auto l" will return error code, skipping if clause,
17 and won't break grep operation by adding an unsupported option.
18
19 --
20 Mike Kazantsev // fraggod.net

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] 'if echo hello' in .bashrc Stroller <stroller@××××××××××××××××××.uk>
Re: [gentoo-user] 'if echo hello' in .bashrc Alan McKinnon <alan.mckinnon@×××××.com>