How do find the number of child processes of a bash script, from within the script itself?
How do find the number of child processes of a bash script, from within the script itself?
If job count (instead of pid count) is enough I just came with a bash-only version:
job_list=($(jobs -p))
job_count=${#job_list[@]}