why test(1) works with -eq but not -nq ?
Ion-Mihai Tetcu
itetcu at apropo.ro
Wed Apr 21 07:05:32 PDT 2004
Hi,
Could somebody explain me why in the second case I get an error (both
with test(1) and with sh's builtin) ?
itetcu at 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"
More information about the freebsd-questions
mailing list