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
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
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,
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
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
:: 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'.
::
::
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
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
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,
$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
10 matches
Mail list logo