The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bourne and decimals?? kdyzsa Shell Programming and Scripting 1 05-06-2008 11:54 PM
handle decimals subin_bala Shell Programming and Scripting 1 04-21-2008 09:03 AM
Req on how to convert hex numbers to decimals hare UNIX for Advanced & Expert Users 3 03-21-2008 11:04 AM
comparing numbers in a file dusk2dawn UNIX for Dummies Questions & Answers 7 09-23-2007 03:54 AM
Comparing two numbers TabloMaxos UNIX for Dummies Questions & Answers 1 12-09-2003 10:25 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2006
chittari chittari is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 10
comparing two numbers with the decimals

Can someone tell me how do I comapre two numbers with the decimals in UNIX shell scripting

I understand "-gt" can be used only for integers

Regards, Giri
  #2 (permalink)  
Old 06-28-2006
preethgideon preethgideon is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 71
Hi Giri,
-le , -lt , -eq , -gt also work.Is this what you want ?

Thanks and regards,
Gideon.
  #3 (permalink)  
Old 06-28-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
just a hint, (not exact solution)

multiply both the operands to a larger value (10^12) and then do the operation
  #4 (permalink)  
Old 06-28-2006
chittari chittari is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 10
Thanx matrixmadhan. Actually I had implemented matrixmadhan idea only and it worked. Thanks for the help dudes

preethgideon, -le , -lt , -eq , -gt work only for comparing integer values
  #5 (permalink)  
Old 06-28-2006
Doc_RuNNeR Doc_RuNNeR is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 17
If you want to compare two numbers with decimals provably you will do with awk.

Bye
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0