RSS Forums RSS
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 69644 | Replies: 4
Join Date: Jun 2005
Posts: 1
Reputation: justsomerat is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
justsomerat justsomerat is offline Offline
Newbie Poster

to convert string to integer value

  #1  
Jun 15th, 2005
How to compare a number stored as string to an integer value in shell scripting? Here is what I have,

if [$temp -ge 2.5] then;

when I run the above code, it gives the error as "Integer Expression expected".
Here the temp variable contains the number "3.0" as a string, I want to compare the value of temp is greater or equal to the number 2.5.
How can I do it.

Please reply soon.

Thanks in advance.

Shiva
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:50 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC