~ubuntu-branches/debian/wheezy/byobu/wheezy

« back to all changes in this revision

Viewing changes to usr/lib/byobu/cpu_freq

  • Committer: Package Import Robot
  • Author(s): Alexander Chernyakhovsky
  • Date: 2012-03-12 00:57:42 UTC
  • mfrom: (0.6.1) (0.1.176 precise)
  • Revision ID: package-import@ubuntu.com-20120312005742-barjtu40fv60w64m
Tags: 5.16-1
Syncing from Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                        # Must scale frequency by number of processors, if counting bogomips
37
37
                        count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo)
38
38
                        freq=$(egrep -i -m 1 "^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ print $2 }')
39
 
                        freq=$(echo "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}')
 
39
                        freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}')
40
40
                fi
41
41
        fi
 
42
        [ -n "$freq" ] || return
42
43
        color b c W; printf "%s" "$freq"; color -; color c W; printf "%s" "$ICON_GHz"; color --
43
44
}
44
45