4.6. Job Control
Job control lets you place foreground jobs in the background,
bring background jobs to the foreground, or suspend
(temporarily stop) running jobs. Job control
is enabled by any of the following commands:
jsh -i Bourne shell
ksh -m -i Korn shell (same as next two)
set -o monitor
Many job control commands take a jobID as an argument.
This argument can be specified as follows:
- Job number n.
- Job whose command line starts with string s.
- Job whose command line contains string s.
- Current job.
- Current job (same as above).
- Previous job.
The Bourne and Korn shells provide the following job control commands.
For more information on these commands, see Section 4.9 later in this chapter.
- Put a job in the background.
- Put a job in the foreground.
- List active jobs.
- Terminate a job.
- Suspend a background job.
- stty tostop
- Stop background jobs if they try to send output to the terminal.
(Note that stty is not a built-in command.)
- Suspend a job-control shell (such as one created by su).
- Wait for background jobs to finish.
- Suspend a foreground job. Then use bg or fg. (Your
terminal may use something other than CTRL-Z as the suspend
Copyright © 2003 O'Reilly & Associates. All rights reserved.