OK, got it. So the total number of processes is counted for all existing processes, not just the new/child processes. My test script failed because even when I set $soft and $hard to 100, I have already more than 100 processes lying around at that time, so I cannot make new processes. And when I set $soft larger than $hard (e.g. $soft=2 and $hard=1), the behaviour becomes... well, let's say undefined, since it's not described in the manpages.