On 23/09/15 08:17 +0200, Ulrich Windl wrote:
>>>> Lars Ellenberg <[email protected]> schrieb am 22.09.2015 um 14:30
>>>> in Nachricht <[email protected]>:
>> So, unless you happen to have an explicitly set to the empty string
>> OCF_RESKEY_syslog_ng_binary in your environment, things work just fine.
>> And if you do, then that's the bug.
> 
> You are right: if X is unset ${X-Y} will do (in addition to ${X:-Y}, but if X
> has no value only the latter will do:
> 
> v04:~> X=1
> v04:~> echo ${X-Y}
> 1
> v04:~> X=
> pv04:~> echo ${X-Y}
> 
> v04:~> unset X
> v04:~> echo ${X-Y}
> Y
> pv04:~> X=1
> v04:~> echo ${X:-Y}
> 1
> v04:~> X=
> v04:~> echo ${X:-Y}
> Y
> v04:~> unset X
> pv04:~> echo ${X:-Y}
> Y
> v04:~>
> 
> Still I think it's wrong, simply because it's not documented.

In fact it is, at least since bash 2.0 (~1996):
http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1?id=ccc6cda#n1821

> omitting the colon results in a test only for a parameter that is unset

But don't be worry, I was trapped on this for a bit, too :)

-- 
Jan (Poki)

Attachment: pgpP9XuQG7bN9.pgp
Description: PGP signature

_______________________________________________
Users mailing list: [email protected]
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

Reply via email to