Sorry, that's a cut/paste/patch from a larger function.
There's a problem using cpuinfo for determining the number of processors.
Imagine the following:
processor : 0
...
model name : AMD Ryzen 7 3800X 8-core processor
...
model name makes tail return invalid information.
If there were such thing as "proper" way, I'd suspect awk'ing the second field of -F: and grep'ing numeric only - which is not "fool proof" but may serve most instances
cat /proc/cpuinfo | grep processor | awk -F: '{print $2}' | grep -Eo '[0-9]{0,9}' | tail -n 1
# and then value+1
...but the next guy will say they can do it better, so, se-lä-vē!
Or is it Say La Vee!? Everyone's got their own! (C'est la vie)
Intention: To manually count "Processor : #" to get the largest value, add one and use that count for make -j${VALUE} when nproc() is unavailable (and not having to install an extension just to have nproc() basically do the same thing in the end.)
Additionally: I don't own "every" processor ever made, thus I cannot ensure grep -Eo wouldn't fail under certain conditions, too.