From owner-freebsd-questions@FreeBSD.ORG Wed Apr 21 07:05:32 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 11EEE16A4CF for ; Wed, 21 Apr 2004 07:05:32 -0700 (PDT) Received: from smtp.rdsnet.ro (smtp.rdsnet.ro [62.231.74.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B54343D4C for ; Wed, 21 Apr 2004 07:05:31 -0700 (PDT) (envelope-from itetcu@apropo.ro) Received: (qmail 21019 invoked by uid 89); 21 Apr 2004 14:01:44 -0000 Received: from unknown (HELO rdsnet.ro) (62.231.74.131) by 0 with SMTP; 21 Apr 2004 14:01:44 -0000 Received: (qmail 25820 invoked from network); 21 Apr 2004 14:05:29 -0000 Received: from unknown (HELO buh.cameradicommercio.ro) (81.196.25.19) by mail.rdsnet.ro with SMTP; 21 Apr 2004 14:05:29 -0000 Received: from it.buh.cameradicommercio.ro (it.buh.cameradicommercio.ro [192.168.0.10]) by buh.cameradicommercio.ro (Postfix) with ESMTP id 97191620B for ; Wed, 21 Apr 2004 17:05:09 +0300 (EEST) Received: from localhost (localhost.buh.cameradicommercio.ro [127.0.0.1]) by it.buh.cameradicommercio.ro (Postfix) with ESMTP id 57C312C5 for ; Wed, 21 Apr 2004 17:09:16 +0300 (EEST) Received: from it.buh.cameradicommercio.ro ([127.0.0.1])port 10024) with ESMTP id 19729-07 for ; Wed, 21 Apr 2004 17:09:15 +0300 (EEST) Received: from it.buh.cameradicommercio.ro (localhost.buh.cameradicommercio.ro [127.0.0.1]) by it.buh.cameradicommercio.ro (Postfix) with SMTP id 5E490144 for ; Wed, 21 Apr 2004 17:09:15 +0300 (EEST) Date: Wed, 21 Apr 2004 17:09:14 +0300 From: Ion-Mihai Tetcu To: freebsd-questions@freebsd.org Message-Id: <20040421170914.5a5204a3@it.buh.cameradicommercio.ro> X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at it.buh.cameradicommercio.ro Subject: why test(1) works with -eq but not -nq ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 14:05:32 -0000 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"