bin/102184: the -n switch of the test command does not work
florian.meister at medienhaus.at
Thu Aug 17 13:20:26 UTC 2006
The following reply was made to PR bin/102184; it has been noted by GNATS.
From: Florian Meister <florian.meister at medienhaus.at>
To: Maxim Konovalov <maxim at macomnet.ru>
Cc: bug-followup at freebsd.org
Subject: Re: bin/102184: the -n switch of the test command does not work
Date: Thu, 17 Aug 2006 15:16:42 +0200
Maxim Konovalov wrote:
>> test -n does not work. I always get a return code of zero, no
>> matter if the variable has zero or more characters. I
>> crosschecked it with the -z switch. This switch works with the
>> same test-script.
> Works for me:
> $ /bin/test -n "aa"; echo $?
> $ /bin/test -n ""; echo $?
> $ export n="aa"; /bin/test -n "$n"; echo $?
> $ export n=""; /bin/test -n "$n"; echo $?
what about that:
tpextu02# set testvar="lala" ; [ -n $testvar ] ; echo $? ; echo $testvar
tpextu02# set testvar="" ; [ -n $testvar ] ; echo $? ; echo $testvar
I have printed out the $testvar at the end to ensure the the variable is
More information about the freebsd-bugs