|
|
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_listThis 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.