Date: Thu, 17 Aug 2006 13:27:55 +0200 (CEST) From: Florian Meister <florian.meister@medienhaus.at> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Florian Meister <florian.meister@medienhaus.at> Subject: bin/102184: the -n switch of the test command does not work Message-ID: <200608171127.k7HBRtWx088298@tpextu02.tele.net> Resent-Message-ID: <200608171130.k7HBUEMl099787@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 102184
>Category: bin
>Synopsis: the -n switch of the test command does not work
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 17 11:30:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Florian Meister
>Release: FreeBSD 6.1-RELEASE amd64
>Organization:
Teleport Consulting and Systemmanagement GmbH
>Environment:
System: FreeBSD tpextu02.tele.net 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:15:57 UTC 2006 root@bloom.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP amd64
>Description:
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.
>How-To-Repeat:
sample shell script:
--snip--
jail_interface="lala"
if [ -n ${jail_interface} ]; then
echo "interface: -$jail_interface-"
fi
--snap--
try to replace the variable jail_interface with nothing - same result. If you replace -n with -z you get the expected results.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608171127.k7HBRtWx088298>
