DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Controlling processes

Waiting for background jobs to finish before proceeding

The wait(C) command is useful when you want to wait for the completion of background processes before performing a foreground command on them. For example:

   $ spell file1 > spell_file1 &
   [1]     13655
   $ spell file2 > spell_file2 &
   [2]     13657
   $ wait
   $ sort spell_file1 spell_file2 > spell_list
This script file runs the two spell(C) commands simultaneously in the background, waits for them both to complete, and then sorts the resultant files (spell_file1 and spell_file2), putting the output in spell_list.

See also ``Automating frequent tasks'' for details of script files.


Next topic: Finding out what jobs are running
Previous topic: Background jobs and job numbers

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005