3 ms·
> This is where you need to use awk. I think need is a strong statement in this context. echo $(( 1 + $(grep 'cpu cores' /proc/cpuinfo | head -1 | awk -F ':
by lsofzz 6y ago
> This is where you need to use awk.
I think need is a strong statement in this context.
echo $(( 1 + $(grep 'cpu cores' /proc/cpuinfo | head -1 | awk -F ':' '{print $2}') ))
Choosing shell vs. [insert modern] programming is a matter of trade-off of taste, time, $$$, collective consensus (in a team setting) and so forth.
[edit]: Forgot code syntax on HN.