![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| check the given string is numeric or not. | knowledge_gain | High Level Programming | 11 | 02-03-2009 11:25 AM |
| problem in comparing numeric with string | naren_0101bits | Shell Programming and Scripting | 7 | 01-29-2008 11:57 AM |
| Perl code to differentiate numeric and non-numeric input | Raynon | Shell Programming and Scripting | 11 | 08-04-2007 10:32 AM |
| With Regex Spliting the string into Alphanumeric and Numeric part | ozgurgul | Shell Programming and Scripting | 1 | 06-30-2007 09:52 AM |
| To convert the numeric month into alphabetic | rooh | UNIX for Dummies Questions & Answers | 2 | 08-20-2001 03:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Convert string to numeric
Hi,
I have read some figures from a text file by getting the position and wish to do some checking, but it seem like it won't work. eg. my figure is 0.68 it still go the the else statement, it seems like it treat it as a text instead of number. Anybody can Help ? Thanks. # only one line cat $outfile | while read line do f1=$(echo $line|cut -c 14-17) f2=$(echo $line|cut -c 19-22) f3=$(echo $line|cut -c 24-27) done echo $f1 $f2 $f3 a=$f1 x=0.5 if [ $a -gt $x ] then echo 'Grater ' $f1 $f2 $f3 else echo 'is ok :' fi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|