[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Perl - 32/64 bit signed/unsigned beregninger ??



Hej,

 Jeg har følgende i et bash-script:

 BYTESRCVD=`TIME=(date +%s); RRDRES=300; rrdtool fetch datafile.rrd
AVERAGE -r $RRDRES -e $RRD_END -s $RRD_START  | perl -lnaF: -e '$sum += 
$F[1]; END
{printf "%d\n",$sum * 300}'`

Problemet er, at det tilsyndeladende regner med 32-bit signed værdier....

F.eks. burde jeg få værdien 3357958001 ud for en datafil - men hvis jeg
checker via BYTESRCVD variablen, så får jeg en negativ værdi ud ???

Hvordan får jeg systemet til at kalkulere værdien korrekt ?? Det er måske et
problem med den stump perl-kode, der opsummerer outputtet fra rrdfetch ??

Mvh

Brian Ipsen





 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:27 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *