1 |
On 8 May 2009, at 15:01, Mike Kazantsev wrote: |
2 |
|
3 |
> On Fri, 8 May 2009 14:38:58 +0100 |
4 |
> Stroller <stroller@××××××××××××××××××.uk> wrote: |
5 |
> |
6 |
>> To find the part to which I refer you'll need to scroll down about |
7 |
>> halfway through that page to "Colorize grep"; the author advises |
8 |
>> adding: |
9 |
>> |
10 |
>> if echo hello|grep --color=auto l >/dev/null 2>&1; then |
11 |
>> export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' |
12 |
>> fi |
13 |
>> |
14 |
>> to ~/.bashrc |
15 |
>> |
16 |
>> Why does he echo hello, please? |
17 |
> |
18 |
> Some greps (like BSD one) might not support '--color' option, so "echo |
19 |
> hello|grep --color=auto l" will return error code, skipping if clause, |
20 |
> and won't break grep operation by adding an unsupported option. |
21 |
|
22 |
Ah! I see! Many thanks! |
23 |
|
24 |
Stroller. |