Get cpu count with bash script

From DevOps Notebook
Revision as of 17:50, 27 January 2022 by MilosZ (talk | contribs) (Created page with "<syntaxhighlight lang="bash"> #!/bin/bash CPUCOUNT=`cat /proc/cpuinfo |grep processor |wc -l` echo "CPU COUNT IS: " $CPUCOUNT if [ $CPUCOUNT -lt "5" ] then MAXSES...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<syntaxhighlight lang="bash">

  1. !/bin/bash


CPUCOUNT=`cat /proc/cpuinfo |grep processor |wc -l`


echo "CPU COUNT IS: " $CPUCOUNT


if [ $CPUCOUNT -lt "5" ]

then

MAXSESSIONS="7"

else

MAXSESSIONS="12"

fi

echo "max session:" $MAXSESSIONS


</syntaxhighlight