next up previous contents
Next: Filename Completion Up: Shells Previous: Alias

Job Control

  Job control is present in all the shells, with the exception of the original Bourne shell. The most obvious part of job control is the ability of the shell to place a program ``in the background'' by the addition of an ampersand (&) to the end of the command line. By this, we mean that once the shell and the operating system have gotten the program running, the shell immediately returns a command prompt so that the user may enter further commands without having to wait for the programs to complete running. However, if this program in the background continues to write to stdout or stderr, things might get a little busy on the users terminal.

This ability of the shell to start a program running in the background is only beginning. If a person starts a program running in the foreground, and then they hit C-Z (Control-Z), the program will be paused (put to sleep). If the user types bg, the program will be restarted in the background. If the user types fg, the program will be brought back into the foreground. And the number of programs which can be started and then suspended is not limited to 1. A large number of programs can be suspended into a stack. Some (all?) shells even allow the user to specify which program they wish to be brought back into the foreground. The command jobs will display the stack of suspended jobs.


next up previous contents
Next: Filename Completion Up: Shells Previous: Alias

Gordon Haverland
Sat Oct 9 13:50:48 MDT 1999