[ClusterLabs] Small bug in RA heartbeat/syslog-ng
Jan Pokorný
jpokorny at redhat.com
Fri Oct 2 16:30:06 UTC 2015
On 23/09/15 08:17 +0200, Ulrich Windl wrote:
>>>> Lars Ellenberg <lars.ellenberg at linbit.com> schrieb am 22.09.2015 um 14:30
>>>> in Nachricht <20150922123054.GA26107 at soda.linbit>:
>> 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20151002/e7e03161/attachment-0003.sig>
More information about the Users
mailing list