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 |