Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

wait()ing for a job


I want to write a zsh-script to start several rsync-jobs in background
and 'wait' for each of them to end. I need the return code of each
of them.

From the zsh manpage about the wait builtin:

      wait [ job ... ]
              Wait for the specified jobs or processes.  If job is not given then  all  currently
              active  child processes are waited for.  Each job can be either a job specification
              or the process ID of a job in the job table.  The exit status from this command  is
              that of the job waited for.

The last sentence confuses me:
'wait' seems to be able to wait not only for one but for several jobs.
The last sentence says that the return code of 'wait' is that of
*that* (not "those") job waited for.

I need all return codes -- if one rsync fails, I got a problem.

What is it, what I don't correctly understand from the manpage -- what
does wait according to the return codes of several jobs?

Best regards,

Messages sorted by: Reverse Date, Date, Thread, Author