1 |
On Nov 29, 2007, at 08:20 , Elias Pipping wrote: |
2 |
|
3 |
> On Thu, Nov 29, 2007 at 02:31:07AM +0100, Johan Hattne wrote: |
4 |
>> |
5 |
>> Thanks! The sed got a bit funny, though: |
6 |
>> |
7 |
>> [[ ${CHOST} != *-darwin* ]] && sed blablabla || die |
8 |
>> |
9 |
>> should be |
10 |
>> |
11 |
>> [[ ${CHOST} != *-darwin* ]] && ( sed blablabla || die ) |
12 |
>> |
13 |
>> shouldn't it? Or maybe the if ... else is clearer? |
14 |
> |
15 |
> No, that's perfectly fine ;) |
16 |
|
17 |
I'm not so sure. AND takes precedence over OR, so |
18 |
|
19 |
a && b || c |
20 |
|
21 |
is equivalent to |
22 |
|
23 |
( a && b ) || c |
24 |
|
25 |
But in this case we want |
26 |
|
27 |
a && ( b || c ) |
28 |
|
29 |
because we want c only if a is true but b is false. |
30 |
|
31 |
// Cheers; Johan |
32 |
|
33 |
-- |
34 |
gentoo-alt@g.o mailing list |