#!/bin/bash

#-----------------------------------------------------------
# $Id: nb_cpu.sh 138 2010-05-12 17:34:01Z rosiere $
#-----------------------------------------------------------

#-----[ nb_cpu ]----------------------------------------------
function nb_cpu ()
{
    local FILE_CPUINFO=/proc/cpuinfo;
    if test ! -f ${FILE_CPUINFO}; then
	echo "\"${FILE_CPUINFO}\" don't exist."
	usage;
    fi;
    
    grep -c "processor" ${FILE_CPUINFO};
}

#-----[ Corps ]---------------------------------------------
nb_cpu ${*}
