Skip to content
This repository
Browse code

Fixed bug: awk uses BEGIN not START

  • Loading branch information...
commit a5e15448e0181c0f77eb12eed4e9cc15e347e365 1 parent f3b5342
authored April 01, 2011 icefox committed April 10, 2011

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  git-achievements
6  git-achievements
@@ -83,9 +83,9 @@ function unlock_achievement()
83 83
 
84 84
 function count_command
85 85
 {
86  
-    export power=`awk "START {n=0} /$1/ {n++} END { print log(n)/log(2) }" "$ACTIONLOGFILE"`
87  
-    export count=`awk "START {n=0} /$1/ {n++} END { print n }" "$ACTIONLOGFILE"`
88  
-    #export powerof2=`awk "START {n=0} /$1/ {n++} END { print and(n, n-1) }" "$ACTIONLOGFILE"`
  86
+    export power=`awk "BEGIN {n=0} /$1/ {n++} END { print log(n)/log(2) }" "$ACTIONLOGFILE"`
  87
+    export count=`awk "BEGIN {n=0} /$1/ {n++} END { print n }" "$ACTIONLOGFILE"`
  88
+    #export powerof2=`awk "BEGIN {n=0} /$1/ {n++} END { print and(n, n-1) }" "$ACTIONLOGFILE"`
89 89
     # mysys gawk it old and doesn't have the bitwise operation and :( so we have to use perl for now
90 90
     export powerof2=`echo 'use Env; $y=$ENV{'count'}; $x=($y & ($y-1)); print "$x\n" ' | perl -`
91 91
 

0 notes on commit a5e1544

Please sign in to comment.
Something went wrong with that request. Please try again.