On 17 July 2013 15:50, Mladen Turk <mt...@apache.org> wrote:
> On 07/17/2013 04:01 PM, sebb wrote:
>>
>> May I suggest a short comment is added to the script to document why
>> -z and -n are not used?
>> Someone else reading the script in the future is going to wonder the
>> same-z and -n
>
>
> Some shells do not work well if variable is not set when using -z and -n.
> In case FOO was not set at all they break, but work if FOO="" as expected.

OK, well that information could be added to the script.

> Anyhow, IMHO 'if [ ".$FOO" != . ]' is more readable then 'if [ -n "$FOO" ]'

Why not use:

if [ "$FOO" != "" ]

The . is not very obvious in some fonts, and it's more symmetrical to
quote both sides.

> I always end wondering if I should use -z or -n :)
>
>
> Regards
> --
> ^TM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to