From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 17 11:30:15 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FCCB16A4DF for ; Thu, 17 Aug 2006 11:30:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97C0443D45 for ; Thu, 17 Aug 2006 11:30:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7HBUE3r099788 for ; Thu, 17 Aug 2006 11:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7HBUEMl099787; Thu, 17 Aug 2006 11:30:14 GMT (envelope-from gnats) Resent-Date: Thu, 17 Aug 2006 11:30:14 GMT Resent-Message-Id: <200608171130.k7HBUEMl099787@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Florian Meister Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9CF0116A4DA for ; Thu, 17 Aug 2006 11:28:04 +0000 (UTC) (envelope-from root@tpextu02.tele.net) Received: from tpextu02.tele.net (tpextu02.tele.net [194.208.104.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFE5043D64 for ; Thu, 17 Aug 2006 11:28:00 +0000 (GMT) (envelope-from root@tpextu02.tele.net) Received: from tpextu02.tele.net (localhost [127.0.0.1]) by tpextu02.tele.net (8.13.6/8.13.6) with ESMTP id k7HBRvFZ088299; Thu, 17 Aug 2006 13:27:57 +0200 (CEST) (envelope-from root@tpextu02.tele.net) Received: (from root@localhost) by tpextu02.tele.net (8.13.6/8.13.6/Submit) id k7HBRtWx088298; Thu, 17 Aug 2006 13:27:55 +0200 (CEST) (envelope-from root) Message-Id: <200608171127.k7HBRtWx088298@tpextu02.tele.net> Date: Thu, 17 Aug 2006 13:27:55 +0200 (CEST) From: Florian Meister To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Florian Meister Subject: bin/102184: the -n switch of the test command does not work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Florian Meister List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 11:30:15 -0000 >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: