I wrote a script that shows a number of physical cores of the machine. However, I would like the result to be a number, not a string.
Here's the script:
phycores=echo $sudoPW | cat /proc/cpuinfo | grep -m 1 "cpu cores" | awk '{print $ 4;}'
echo $phycores
for i in {1..$phycores}
do
echo "Core $i"
done