Re: SOLVED(?): [expert] test command

2002-12-22 Thread ath1410
Solved! I should have read man bash pages! Options are one of the Arguments. test arg1 arg2 arg3 .. So, $test -nCR or $test -zCR is just like $test abcCR. -n, -z, or abc is handled as arg1 and as 'a string'. Then test deos not think that -z or -n is an option

Re: SOLVED(?): [expert] test command

2002-12-21 Thread milosh
wuha, i am sorry to say that, but what i wrote was mostly wrong :( it's just too simple. i didn't saw cause i assumed to deal with a strange situation. but this is just normal behaviour. you wrote: $echo $? returns 0 after these test commands. $test -z $test -z first of all. my biggest

Re: [expert] test command

2002-12-20 Thread ath1410
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,

Re: [expert] test command

2002-12-20 Thread jipe
On Fri, 20 Dec 2002 18:18:10 +0900 ath1410 [EMAIL PROTECTED] wrote: 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

Re: [expert] test command

2002-12-20 Thread milosh
On Fri, Dec 20, 2002 at 12:48:01PM +0100, jipe wrote: On Fri, 20 Dec 2002 18:18:10 +0900 ath1410 [EMAIL PROTECTED] wrote: $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

Re: [expert] test command

2002-12-20 Thread Dean S. Messing
:: 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'. :: ::

Re: [expert] test command

2002-12-20 Thread ath1410
Tks Mr.miLosh Mr.Dean, This problem is getting clear now. However, let me please ask one more question that still remains in me. Mr.miLosh advised; first of all, in the '-z' example u r giving a string, which

Re: [expert] test command

2002-12-19 Thread milosh
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

Re: [expert] test command

2002-12-19 Thread ath1410
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,

[expert] test command

2002-12-18 Thread ath1410
$echo $? returns 0 after these test commands. $test -z "" $test -z But it returns different value after followings. $test -n ""-- echo$? returns 1 $test -n -- " " 0 Can someone explain why it goes as above? Especially I don't figure out why