Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Korn Shell and arithemetic

RE: Korn Shell and arithemetic

From: Lex de Haan <lex.de.haan_at_naturaljoin.nl>
Date: Wed, 23 Jun 2004 20:20:15 +0200
Message-ID: <JFEEIGBIDOCCDALDIPLNEEONCEAA.lex.de.haan@naturaljoin.nl>


Tim is using command substitution (with the ` characters) calling the bc command -- which is a brilliant programmable calculator on Unix, with unlimited precision.
see below:
[lex_at_node42]$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'.
1.2 > 1.0
1
quit
[lex_at_node42]$

Kind regards,
Lex.



visit my website at http://www.naturaljoin.nl

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of ryan.gaffuri_at_comcast.net
Sent: Wednesday, June 23, 2004 18:57
To: oracle-l_at_freelists.org
Subject: OT: Korn Shell and arithemetic

Tim,

what does this syntax mean?

    $ if [[ "`bc << __EOF__^J1.2 > 1.0^J__EOF__`" = "1" ]]
> then
> echo yes
> else echo no
> fi

    yes

    $ if [[ "`bc << __EOF__^J1.2 > 1.3^J__EOF__`" = "1" ]]
> then
> echo yes
> else echo no
> fi



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://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_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Jun 23 2004 - 13:17:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US