Tks for reply.

I understand the way $test -z "" returns 0 and $test -n "" returns 1.

What's puzzling me here is this.

$test -z (there is no space after -z, no argment) returns 0 which means 'test command 
thinks no argment equals to the
empty string'.

However, $test -n (no space after, no argment) return 0 which
means 'test command in this case thinks no argment equals to
NO-empty string'.

When no argment is given, why test command thinks differenly
depending on the options -z and -n. 
 
Can you help??

>
>On Thu, Dec 19, 2002 at 12:44:30PM +0900, ath1410 wrote:
>> $test -z ""
>this tests whether the string is empty. in this example it
>is, therefor exit code 0.
>
>> 
>> But it returns different value after followings.
>> 
>> $test -n ""    -- echo$? returns 1
>> $test -n       --  "       "     0
>
>this tests whether the string is NOT empty. the first one
>is empty, so exit code is 1. the second one isn't empty.
>i guess that you think that spaces count as empty strings,
>but a space is a character as everyone (ascii 039), 
>therefor your string isnt empty and exit code is 0.
>
>okey?
>
>have phun;)
>miLosh
>


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+---------+ * Get your own Jmail account.|URL= http://www.jmail.co.jp
|--jmail--| * Get your own home page.|URL= http://www.servance.jp
+---------+ * Get your own domain.|URL= http://domaintorou.com/
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Reply via email to