1 |
On 09/13/2011 07:24, Amadeusz Żołnowski wrote: |
2 |
|
3 |
> Hi, |
4 |
> |
5 |
> |
6 |
> Excerpts from Michal Hrusecky's message of 2011-09-13 13:11:28 +0200: |
7 |
>> Comments and improvements are welcome. |
8 |
> |
9 |
> Just some minor remarks: |
10 |
> |
11 |
> |
12 |
>> [[ -z ${OPENSUSE_RELEASE} ]] || OBS_PROJECT="openSUSE:${OPENSUSE_RELEASE}" |
13 |
>> [[ -n ${OBS_PROJECT} ]] || die "OBS_PROJECT not set!" |
14 |
>> [[ -n ${OBS_PACKAGE} ]] || die "OBS_PACKAGE not set!" |
15 |
> |
16 |
> You don't need -n/-z with [[. |
17 |
> |
18 |
> [[ $var ]] == [[ -n $var ]] |
19 |
> [[ ! $var ]] == [[ -z $var ]] |
20 |
> |
21 |
|
22 |
What about other comparisons, like -f, -e, or -d? Bash's manpage only says |
23 |
[[ expression ]] -- it doesn't seem to go into the level of detail (at least |
24 |
not in the section that I quickly perused) about what flag operators are |
25 |
necessary or not. |
26 |
|
27 |
Also, is this a bash4-only thing, or bash3 and/or bash2 as well? |
28 |
|
29 |
If yes to above, we should get this edited and fixed up, then, because it |
30 |
uses -z/-n inside [[ ]]: |
31 |
http://devmanual.gentoo.org/tools-reference/bash/index.html |
32 |
|
33 |
Oh, forgot, it won't break initscripts, will it? |
34 |
|
35 |
-- |
36 |
Joshua Kinard |
37 |
Gentoo/MIPS |
38 |
kumba@g.o |
39 |
4096R/D25D95E3 2011-03-28 |
40 |
|
41 |
"The past tempts us, the present confuses us, the future frightens us. And |
42 |
our lives slip away, moment by moment, lost in that vast, terrible in-between." |
43 |
|
44 |
--Emperor Turhan, Centauri Republic |