[plug] problem found in "if" statement

Jon Miller jlmiller at mmtnetworks.com.au
Thu Aug 28 17:58:54 WST 2003


Tried that and got an error stating:
[: -ge: unary operatory expected

JLM


Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

"I don't know the key to success, but the key to failure
 is trying to please everybody." -Bill Cosby



>>> John.Usher at perth.maptek.com.au 8:58:11 AM 28/08/2003 >>>
[ is test (/usr/bin/[ is usually symlinked to test).

According to the 'test' manpage, >= is not supported

try:

if [ "$vMLSTAT" -ge 0 ]; then
...

-----Original Message-----
From: Arie Hol [mailto:arie99 at ozemail.com.au] 
Sent: Wednesday, 27 August 2003 8:10 PM
To: plug at plug.linux.org.au 
Subject: Re: [plug] problem found in "if" statement


At 09:13 AM 27-08-2003 +0800, you wrote:
>I've found a problem in an "if" statement and cannot find a fix.  The
statement is
>if [ "$vMLSTAT" >= 0 ]; then
>  .....
>  .....
>
>fi
> I'm getting a unary operator expected.  


Could it be because you are trying to evaluate a 'string' against an
'integer' in the hope that you will get  a 'boolean' as a result ?????
Regards Arie Hol

>--------------------------------------------<

For the concert of life, nobody has a program.

>--------------------------------------------<






More information about the plug mailing list