RE: korn shell and arithmetic

  • From: "Mercadante, Thomas F" <thomas.mercadante@xxxxxxxxxxxxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 22 Jun 2004 13:24:21 -0400

Ryan,

And try this:

#!/bin/ksh

if [ 1.2 > 1.0 ]; then
   echo yes
else echo no
fi
echo done1

let "v1 = 1"
let "v2 = 2"
let "v3 = v1 + v2"
echo $v3
if [ $v3 = 3 ]; then
   echo equals 3
Fi



Tom Mercadante
Oracle Certified Professional


-----Original Message-----
From: Mercadante, Thomas F [mailto:thomas.mercadante@xxxxxxxxxxxxxxxxx] 
Sent: Tuesday, June 22, 2004 1:15 PM
To: 'oracle-l@xxxxxxxxxxxxx'
Cc: 'ryan.gaffuri@xxxxxxxxxxx'
Subject: RE: korn shell and arithmetic


Ryan,

Did you try this?

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


Worked for me.

Tom Mercadante
Oracle Certified Professional


-----Original Message-----
From: ryan.gaffuri@xxxxxxxxxxx [mailto:ryan.gaffuri@xxxxxxxxxxx] 
Sent: Tuesday, June 22, 2004 1:06 PM
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
-----------------------------------------------------------------
----------------------------------------------------------------
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
-----------------------------------------------------------------
----------------------------------------------------------------
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: