![]() |
|
|
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 |
| Unix:mail sending issue..pls help me soon | bobprabhu | UNIX for Dummies Questions & Answers | 2 | 02-01-2008 05:44 AM |
| Unix Login Issue | freakygs | UNIX for Advanced & Expert Users | 1 | 01-16-2008 08:21 AM |
| Issue with Unix cat command | RcR | Shell Programming and Scripting | 13 | 10-31-2007 05:54 AM |
| Unix command mmin issue | Mohee | UNIX for Dummies Questions & Answers | 1 | 08-30-2007 11:41 PM |
| Unix in a Windows environment issue | Aisha Sturkey | UNIX for Dummies Questions & Answers | 6 | 05-02-2005 10:44 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi,
I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding , I am getting the result 2147483647 but actual result is 2156379608 . I found the root cause of this issue is that Unix temproary variable can hold only 2156379608 ( Range of integer ) as it's 32 bit. For eg: a=2147483647 expr $a + 2 you will get the negative result. Because while expr working, the result will be stored in internal temporary variable or register then you will get the result.. but that particular temporary variable or register can accomodate only 2147483647 .. if it crosses this limit, you may get the junk value like -ve values... this is my finiding for this issue.. But I want to have resolution for this issue. how to add or do arthimatic opration if i want to have result more than limit ( 2147483647 ). I mean a=2147483647 expr $a + 2 for this i need to get the right result rather than -ve value. |
| Bookmarks |
| Tags |
| bc, big numbers, gawk, sum by column |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|