1 |
On Tuesday 02 October 2007, George Shapovalov wrote: |
2 |
> Tuesday, 2. October 2007, Roy Marples Ви написали: |
3 |
> > And here it is |
4 |
> |
5 |
> - if [[ "${FORTRANC}" = "gfortran" ]]; then |
6 |
> + if [ "${FORTRANC}" = "gfortran" ]; then |
7 |
> |
8 |
> You know, it is funny to see these lines after all those cries about how [ |
9 |
> is evil and we should really never ever use it but rather always use [[ |
10 |
> form :). |
11 |
> |
12 |
> Oh, btw, does the compliant sh correctly process the most cited |
13 |
> composition? : [ -n $foo ] && [ -z $foo ] && echo "huh?" |
14 |
> (straight from devmanual, the primary reason why [ is considered bad) |
15 |
|
16 |
[...] will crap a brick if foo expands to multiple arguments which is why |
17 |
[[...]] is preferred ... it'll do the sane thing and work correctly |
18 |
regardless |
19 |
-mike |