Each process has its own time limits, but time
shows the cumulative time for the script. Each time you create a child process, that child will have its own limits. So, for example, if you call cut
and grep
in the script then those processes use their own CPU time, the quota is not decremented from the script's, although the limits themselves are inherited.
If you want a time limit, you might wish to investigate trap ALRM
.