1 |
Excerpts from Joshua Kinard's message of 2011-09-13 14:26:02 +0200: |
2 |
> > You don't need -n/-z with [[. |
3 |
> > |
4 |
> > [[ $var ]] == [[ -n $var ]] |
5 |
> > [[ ! $var ]] == [[ -z $var ]] |
6 |
> |
7 |
> What about other comparisons, like -f, -e, or -d? |
8 |
|
9 |
Same as inside [, but no need of quotes inside [[. |
10 |
|
11 |
> Also, is this a bash4-only thing, or bash3 and/or bash2 as well? |
12 |
|
13 |
I'm not sure. |
14 |
|
15 |
OT: When I was going through recruitment process, dberkholz pointed to |
16 |
me that I use things bash4-only. And again: why we need to stick to |
17 |
ancient 3 version? I would understand pseudo POSIX compatibility, but |
18 |
what is the benefit of bash3 compatibility while bash4 is stable |
19 |
already? |
20 |
|
21 |
|
22 |
-- |
23 |
Amadeusz Żołnowski |
24 |
|
25 |
PGP key fpr: C700 CEDE 0C18 212E 49DA 4653 F013 4531 E1DB FAB5 |