On 11/07/2016 10:56 AM, Reuti wrote:
>> You are correct that it states that, but it means that 'test' (with no
>> expression at all) is what results in a false return (that is, an
>> omitted expression is equivalent to zero arguments).  'test -s' is NOT a
>> case of an omitted expression; your expression was '-s'.  Since you
>> provided exactly one argument, you are testing whether '-s' is the empty
>> string (it is not, hence the true result).
> 
> Doesn't -s refer to a FILE existence, it's not -z?

When there are TWO arguments, '-s "$file"' tests for whether file is
empty, and '-z "$string"' tests for whether $string is empty.  But here
we are talking about ONE argument, '-s', which is non-empty.  (Yes, the
one-argument case is identical to using the two-argument -z "$string" case.)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to