Re: [PATCH 2/5] kbuild: fix warning when domainname is not available

Felipe Contreras
2009-09-13T21:42:05Z

On Mon, Sep 14, 2009 at 12:12 AM, Mike Frysinger <vapier.adi@gmail.com> wrote:
> On Sun, Sep 13, 2009 at 15:38, Felipe Contreras wrote:
>> +  if $domain; then
>
> is this really correct ?  i think you meant to use:
> [ -n "$domain" ]

What is the difference?

$domain unset
test -n "" -> false
test -> false

$domain is a valid string
test -n "string" -> true
test "string" -> true

The relevant rules are these:
* An omitted EXPRESSION defaults to false
* STRING equivalent to -n STRING

--
Felipe Contreras