From owner-freebsd-questions@FreeBSD.ORG Wed Apr 21 07:32:45 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EBF816A4CE for ; Wed, 21 Apr 2004 07:32:45 -0700 (PDT) Received: from schtroumpf.dyndns.org (sorbara181.smc-res.utoronto.ca [142.151.138.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id B260743D41 for ; Wed, 21 Apr 2004 07:32:43 -0700 (PDT) (envelope-from ian_leroux@fastmail.fm) Received: by schtroumpf.dyndns.org (Postfix, from userid 1002) id 4589F4131; Wed, 21 Apr 2004 10:32:43 -0400 (EDT) Date: Wed, 21 Apr 2004 10:32:43 -0400 From: "Ian D. Leroux" To: Ion-Mihai Tetcu Message-ID: <20040421143243.GD761@schtroumpf.dyndns.org> References: <20040421170914.5a5204a3@it.buh.cameradicommercio.ro> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040421170914.5a5204a3@it.buh.cameradicommercio.ro> User-Agent: Mutt/1.4.2.1i cc: freebsd-questions@freebsd.org Subject: Re: why test(1) works with -eq but not -nq ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Ian D. Leroux" List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 14:32:45 -0000 try -ne instead of -nq :-) Ian On Wed, Apr 21, 2004 at 05:09:14PM +0300, Ion-Mihai Tetcu wrote: > Hi, > > > Could somebody explain me why in the second case I get an error (both > with test(1) and with sh's builtin) ? > > itetcu@it> /var/log/ports [16:51:38] 0 > # sh > # cat ports_sup_log | wc -l > 3 > # if [ "`cat ports_sup_log | wc -l`" -eq "3" ]; then echo 'da'; fi > da > # if [ "`cat ports_sup_log | wc -l`" -nq "3" ]; then echo 'da'; fi > [: 3: unexpected operator > > # if (/bin/test "`cat ports_sup_log | wc -l`" -eq "3") ; then echo 'da'; fi > da > # if (/bin/test "`cat ports_sup_log | wc -l`" -nq "3") ; then echo 'da'; fi > test: 3: unexpected operator > > > > -- > IOnut > Unregistered ;) FreeBSD "user" > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"