Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2004 10:32:43 -0400
From:      "Ian D. Leroux" <ian_leroux@fastmail.fm>
To:        Ion-Mihai Tetcu <itetcu@apropo.ro>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: why test(1) works with -eq but not -nq ?
Message-ID:  <20040421143243.GD761@schtroumpf.dyndns.org>
In-Reply-To: <20040421170914.5a5204a3@it.buh.cameradicommercio.ro>
References:  <20040421170914.5a5204a3@it.buh.cameradicommercio.ro>

next in thread | previous in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040421143243.GD761>