I know that you can use this to start a process in the background, without getting the notification when the process is put in the background and when it is done like so:(command &) &> /dev/nullHowever this removes the option to trap when the process finishes (trap child_done CHLD).How can I have both?
Silently start task in background
process;zsh;trap
task-spooler might help you.As in freshmeat.net:task spooler is a Unix batch system where the tasks spooled run one after the other. The amount of jobs to run at once can be set at any time. Each user in each system has his own job queue. The tasks are run in the correct context (that of enqueue) from any shell/process, and its output/results can be easily watched. It is very useful when you know that your commands depend on a lot of RAM, a lot of disk use, give a lot of output, or for whatever reason it's better not to run them all at the same time, while you want to keep your resources busy for maximum benfit. Its interface allows using it easily in scripts.Task-spooler is available in Debian, Ubuntu and other distros. It lets you have a queue of tasks to run, and access their outputs just at wish. For example: $ tsp sleep 50 $ tsp sleep 5 1$ tspID   State      Output               E-Level  Times(r/u/s)   Command [run=1/1]2    running    /tmp/ts-out.ZWn6Le                           sleep 51    finished   /tmp/ts-out.Fhlcle   0        5.00/0.00/0.01 sleep 5If you run a lot of jobs in background, it will definitely help you. You can either run them sequentially or in a preset amount of slots. You can also establish dependencies among the tasks (run task1 only if task0 completed successfully).