![]() |
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 |
| 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 |
|
|
|
|||||
|
Quote:
Code:
#!/usr/bin/env perl -w
$bc_lines=100;
local $maxint=int(2*(2**30 - 1)+1);
my $a=0;
my @subresults;
while ($_=<>) {
chop;
if ($maxint - int($_) < $a) {
push @subresults, $a;
$a=0;
}
$a+=int($_);
}
while (scalar(@subresults)) {
print join("+\\\n",splice(@subresults,0,$bc_lines),"0\n");
}
Code:
cp bigfile.txt outfile.txt while [ ! -f outfile.txt -o `grep -c ^ outfile.txt` -gt 1 ]; do perl test.pl outfile.txt |bc >outfile.$$ ; mv outfile.$$ outfile.txt; echo "Subcalc complete" >&2; done ; cat outfile.txt the GNU bc link is in my previous post. |
|
|||||
|
Quote:
Depends on if the programs are compiled in 64-bit. Try Code:
file `which bc` `which awk` `which perl` For installing bc, you'll have to go to the home page, whose link I provided, and follow the steps. You'll probably need the sysadmin's help, but in theory, you can do something like: Code:
gunzip -c gbc-*tgz | tar xf - cd gbc???? ./configure --prefix=$HOME make install |
|
||||
|
I got the below result...
$ file `which bc` `which awk` `which perl` /usr/bin/bc: PA-RISC1.1 shared executable dynamically linked /usr/bin/awk: PA-RISC1.1 shared executable dynamically linked /usr/bin/perl: PA-RISC1.1 shared executable dynamically linked -not stripped $ Meantime, I just waiting for my Unix admin's response to install GNU bc. If i install GNU bc, current version bc will be affected. I mean GNU bc having all the features ? |
![]() |
| Bookmarks |
| Tags |
| bc, big numbers, gawk, sum by column |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|