function cpunrs () { if [ "${1:0:2}" == "-h" ]||[ "${1:0:2}" == "-?" ] then echo -e "\033[0;32mReinis ${FUNCNAME[0]} V1.0\033[0m" echo "Reinis .bashrc Tools" echo "" echo "Zeigt die Anzahl der CPUs von IP-Adresse" echo "" echo "IP-Adresse default ist localhost" echo "" return fi if echo $1 |egrep '.*\..*\..*\..*' >/dev/null 2>&1 then remote=$(echo "ssh $1") cpunr=$(echo "$2") else remote=$(echo "") cpunr=$(echo "$1") fi if [ "$remote" == "" ] then remot=$(echo "localhost") else remot=$(echo "$remote") fi $remote cat /proc/stat|grep '^cpu'|awk '{print $1}' }