RE: Korn Shell and arithemetic

  • From: "Lex de Haan" <lex.de.haan@xxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 23 Jun 2004 20:20:15 +0200

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@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@node42]$

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: Wednesday, June 23, 2004 18:57
To: oracle-l@xxxxxxxxxxxxx
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@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: