Since it's common to write shell scripts which pass the number of jobs to a command, I'm interested to know what a good, portable way is to get the number of processors on mainstream * Unix systems.
Something like this but not depending on Python.
* By mainstream, I mean that will work on popular Unix system used in production today (Linux/BSD's/Darwin? But the more portable the better).