Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 69644 | Replies: 4
•
•
Join Date: Jun 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Threaded Mode