<quote who="[EMAIL PROTECTED]">
> On Tue, 18 Mar 2003 21:02:38 +1100
> John Ferlito <[EMAIL PROTECTED]> wrote:
>
> > $ awk '{ if(/bogomips/){ SUM+=$3 } } END {print SUM}' /proc/cpuinfo
>
> Except no need for if, '/pattern/ {action}' is idiomatic awk:
>
> $ awk '/bogomips/ { SUM+=$3 } } END {print SUM}' /proc/cpuinfo
Heh, first and second prize to you guys, once you worked out the finer
detail. :-)
$ awk '/bogomips/ { SUM+=$3 } END {print SUM}' /proc/cpuinfo
6121.06
Nice one!
- Jeff
--
"Science helps a lot, but people built perfectly good brick walls long
before they knew why cement works." - Alan Cox
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug