Ignore:
Timestamp:
08/17/2007 04:24:47 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
e5842d6
Parents:
3abe9d7
Message:

Dump build time using Bash $SECONDS internal variable instead of using date calls + Perl-based calculations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/create-sbu_du-report.sh

    r3abe9d7 r68713c9  
    5454BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
    5555echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value."
    56 SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $BASELOG`
     56SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG`
    5757echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds.\n"
    5858echo -e "\n\n$LINE\n\nThe SBU unit value is equal to $SBU_UNIT seconds.\n" >> "$REPORT"
     
    7171# Start SBU calculation
    7272# Build time
    73   TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $log`
     73  TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $log`
    7474  SECS=`perl -e 'print ('$TIME' % '60')';`
    7575  MINUTES=`perl -e 'printf "%.0f" , (('$TIME' - '$SECS') / '60')';`
    76   SBU=`perl -e 'printf "%.3f" , ('$TIME' / '$SBU_UNIT')';`
     76  SBU=`perl -e 'printf "%.1f" , ('$TIME' / '$SBU_UNIT')';`
    7777
    7878# Append SBU value to SBU2 for grand total
    79   SBU2=`perl -e 'printf "%.3f" , ('$SBU2' + '$SBU')';`
     79  SBU2=`perl -e 'printf "%.1f" , ('$SBU2' + '$SBU')';`
    8080
    8181# Start disk usage calculation
Note: See TracChangeset for help on using the changeset viewer.