[OpenSIPS-Users] opensipsctl erros
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Mon May 3 11:00:33 CEST 2010
Hi guys,
the Airton's report may be right - the correct operator for string
comps is "==" and not "-eq" (which is used for arithmetic operands):
http://tldp.org/LDP/abs/html/comparison-ops.html
So, we might need to change the script to be on the safe side.
Regards,
Bogdan
Vadim Grinco wrote:
> Hi,
>
> On Fri, Apr 30, 2010 at 4:32 PM, brianpocock
> <briankeithjames at googlemail.com
> <mailto:briankeithjames at googlemail.com>> wrote:
>
>
> Just checked my configuration and it works fine for me with:
> if [ $DBENGINE -eq "MYSQL" ]
> when doing opensipsctl alias_db list/show
>
> Not sure whether you made a typo with:
> if [ $DBENGINE -eq "MYSQL" ]
> if [ $DBENGINE -eq "PGSQL" ]
>
> but it should read:
> if [ $DBENGINE -eq "MYSQL" ]
> elif [ $DBENGINE -eq "PGSQL" ]
>
> I don't see any substantial difference between if and elif in this
> situation. Yes, it will save you a couple of milliseconds to execute
> because it won't do the second comparison, but the logyc is the same.
> In this case the operator is incorrect. If you man sh, you will see
> that -eq is an arithmetic binary operator, but = or == is used to
> compare strings.
>
> You might have an interpreter which will understand both versions, but
> don't forget there're lots of them out there.
>
>
>
> Hope this helps
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/opensipsctl-erros-tp4985896p4985961.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> --
> Best regards,
> Vadim Grinco
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Bogdan-Andrei Iancu
www.voice-system.ro
More information about the Users
mailing list