RE: korn shell and arithmetic

  • From: "Lex de Haan" <lex.de.haan@xxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 22 Jun 2004 19:13:00 +0200

Hi Ryan,
at least my shell is giving a clear error message:

[: 1.2: integer expression expected

and the "man test" command clearly talks about integers being expected.
hope this helps,
 
Kind regards,
Lex.
 
---------------------------------------------
visit my website at http://www.naturaljoin.nl
---------------------------------------------
 


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of
ryan.gaffuri@xxxxxxxxxxx
Sent: Tuesday, June 22, 2004 18:06
To: oracle-l@xxxxxxxxxxxxx
Subject: OT:korn shell and arithmetic


I don't know any unix listservs... so I hope this is ok.

I am trying to do the following:

if [ 1.2 -gt 1.0 ]; then
   echo yes
else echo no
fi

It alwys comes out no? Anyway to get around this? 

Also when I do:

expr 0 + 0, I get a $? of 1, which kills my error handling. any idea why? 
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


-- Binary/unsupported file stripped by Ecartis --
-- Type: text/x-vcard
-- File: Lex de Haan.vcf


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: